astbuilder

0.0.3 • Public • Published

AST Builder


Set of tools to easy building ast.

Plug in with escodegen to simply generate javascript code from function calls.

Usage:

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

Dependents (0)

Package Sidebar

Install

npm i astbuilder

Weekly Downloads

0

Version

0.0.3

License

ISC

Last publish

Collaborators

  • choover