vee-eight
Safely execute arbitrary untrusted JavaScript from nodejs. This module implements a lightweight isolated JavaScript environment that can be used to run any code without being able to escape the sandbox. The V8 context is initialized and executed entirely from C++ so it's impossible for the JS stack frames to lead back to the nodejs environment. It's usable from a nodejs process, but the JS environment is pure V8.
See example.js for usage
Installation
npm install vee-eight
Once installed, import it into your module via:
const VeeEight = VeeEight
API
Initialize a new VeeEight instance:
const v8 =
Use execute(code) to run the specified code block:
v8// #=> 3
State will be preserved between function calls:
v8v8// # => 42
To clear the context invoke reset():
v8v8// # => ReferenceError: s is not defined
To limit long running operations, set a timeout with: timeout(milliseconds):
v8 // 1 second timeoutv8// # => timed out
License
vee-eight is licensed under The MIT License