You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across an interesting module in the Node stdlib called vm. Since alasql makes heavy use of evaluating strings as functions as I thought this may be something to look at.
It allows you to specify to explicitly specify the execution context for a given script. Therefore you can disable things like requiring external modules, the filesystem api, etc
const vm = require('vm')
vm.runInContext('require("foo")', {})
ReferenceError: require is not defined
The text was updated successfully, but these errors were encountered:
I agree the performance trade off would be worth measuring. I don't think you could run all of alasql inside a vm without disabling user defined functions. User defined functions in general are the tricky part I think.
I came across an interesting module in the Node stdlib called vm. Since alasql makes heavy use of evaluating strings as functions as I thought this may be something to look at.
https://nodejs.org/api/vm.html
It allows you to specify to explicitly specify the execution context for a given script. Therefore you can disable things like requiring external modules, the filesystem api, etc
The text was updated successfully, but these errors were encountered: