the-forest/client/node_modules/static-eval/example/eval.js

8 lines
191 B
JavaScript
Raw Normal View History

2024-09-17 20:35:18 -04:00
var evaluate = require('static-eval');
var parse = require('esprima').parse;
var src = process.argv.slice(2).join(' ');
var ast = parse(src).body[0].expression;
console.log(evaluate(ast));