Set of tools to easy building ast.
Plug in with escodegen to simply generate javascript code from function calls.
const ast = require('astbuilder');
const escodegen = require('escodegen');
const ast = ast.program([ast.AssignmentExpression(ast.Identiifer('a'), ast.Literal(2))]);
let code = escodegen.generate(ast);
eval(code);
console.log(a); // 2