[Pkg-javascript-commits] [node-astw] 04/30: docs

Bastien Roucariès rouca at moszumanska.debian.org
Tue Sep 26 12:55:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-astw.

commit 2eb86774e2653e4d3d65483be82c7b586215ee8c
Author: James Halliday <mail at substack.net>
Date:   Sat Mar 2 02:22:27 2013 -0800

    docs
---
 readme.markdown | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/readme.markdown b/readme.markdown
new file mode 100644
index 0000000..b869196
--- /dev/null
+++ b/readme.markdown
@@ -0,0 +1,48 @@
+# astw
+
+walk the ast
+
+This module is a faster version of
+[falafel](https://github.com/substack/node-falafel)
+that only does ast walking and `.parent` tracking, not source transforms.
+
+# example
+
+``` js
+var astw = require('astw');
+var deparse = require('escodegen').generate;
+var walk = astw('4 + beep(5 * 2)');
+
+walk(function (node) {
+    var src = deparse(node);
+    console.log(node.type + ' :: ' + JSON.stringify(src));
+});
+```
+
+# methods
+
+``` js
+var astw = require('astw')
+```
+
+## var walk = astw(src)
+
+Return a `walk()` function from the source string or ast object `src`.
+
+## walk(cb)
+
+Walk the nodes in the ast with `cb(node)` where `node` is each element in the
+ast from [esprima](http://esprima.org/) but with an additional `.parent`
+reference to the parent node.
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```
+npm install astw
+```
+
+# license
+
+MIT

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-astw.git



More information about the Pkg-javascript-commits mailing list