node.js - Turn JavaScript code into an AST? -


i write function in node.js receives function parameter, , returns function ast. e.g.:

var fn = function (x) {   return x > 23; };  var ast = generateastfrom(fn);  console.log(ast); // => abstract syntax tree representing //    expression "return x > 23" 

now wonder whether possible @ all. main problem have absolutely no idea or how begin.

any hints?

ps: know can .js files using projects such esprima, function in memory. maybe i'm missing right kick-off point here?


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -