0.1.2 • Published 3 years ago

@johndaniels/es-interpreter v0.1.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 years ago

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);