the-forest/client/node_modules/static-eval/example/eval.js
2024-09-17 20:35:18 -04:00

8 lines
191 B
JavaScript

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