1.2.0 • Published 5 years ago
virdo v1.2.0
virdo
Virtually run JS scripts
What?
What this is:
- An actual, honest to God, JS sandbox.
What this is not:
eval
- A subprocess running node with low priviliges.
- A find-and-replace blackbox.
- An actual, honest to God, JS sandbox with 100% language spec compliance.
- Some minor features are not supported yet (such as
class
es andthis
).
- Some minor features are not supported yet (such as
Usage
const js = require('virdo');
console.log(
js(`
let a = 4;
if (false) {
a++;
}
a;
`)
); // this prints out 4
js(`print(4)`, { print: console.log }); // prints 4