Execute a callback on every node of a source code's AST and stop walking when you see fit
Execute a callback on every node of a file's AST and stop walking whenever you see fit.
npm install node-source-walk
var Walker = ;var walker = ;// Assume src is the string contents of myfile.js// or the AST of an outside parse of myfile.jswalker;
By default, Walker will use
babylon (supporting ES6, JSX, Flow, and all other available babylon plugins) and the
sourceType: module, but you can change any of the defaults as follows:
var walker =sourceType: 'script'// If you don't like experimental pluginsplugins:'jsx''flow';