https://github.com/ariya/esprima
var esprima = require();
var program = '';
esprima.tokenize();
[ { type: 'Keyword', value: 'const' },
{ type: 'Identifier', value: 'answer' },
{ type: 'Punctuator', value: '=' },
{ type: 'Numeric', value: '42' } ]
esprima.parseScript(program);
{ type: 'Program',
body:
[ { type: 'VeriableDeclaration',
declarations: [Object],
kind: 'const' } ],
sourceType: 'script' }