walker, texas ranger
very simple walker for estree AST
Installation
$ npm install walkes
Or as a component
:
$ component install Swatinem/walkes
Compatibility warning
walkes ~ 0.1.0
used to pass in the node as this
. This changed with version
~ 0.2.0
which passes it as the first parameter. Please keep that in mind, and
sorry for the inconvenience.
Usage
walkes works with an estree spec compatible
ast. You are free to choose whichever parser you would like, such as esprima,
espree, babel, acorn or others.
walker(espree.parse("…"), {
MemberExpression: function (node, recurse, stop) {
recurse(node.object);
recurse(node.property);
walker.checkProps(node, recurse);
},
default: function (recurse, stop) {
stop();
throw stop;
}
}, offset);
License
LGPL-3.0