@johndaniels/es-interpreter
v0.1.2
Published
This is a sandboxed intepreter for Javascript written in Javascript.
Downloads
4
Readme
ES Interpreter
This is a sandboxed intepreter for Javascript written in Javascript.
This is largely based on the JS-Interpreter project, but updated to use typescript, be an npm package, and have tests.
Installation
npm install es-interpreter
yarn add es-interpreter
Usage
const code = `
function addOne(number) {
return number + 1
}
var a = 5;
addOne(a);
`
const interpreter = new Interpreter(code, null);
const paused = interpreter.run();
console.log(interpreter.value);