Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Simplest example of Esprima parser
node v4.9.1
version:
1.0.3
endpoint
share
tweet
Load Esprima module:
var esprima = require('esprima');
Parse a specific input:
var input = 'answer = 42'; var tree = esprima.parse(input);
Show the resulting syntax tree:
console.log(JSON.stringify(tree, null, 2));
Loading…
no comments
sign in
to comment