0.0.5 • Published 12 years ago
defnode v0.0.5
defnode
defnode is a node.js package that maps JavaScript Identifier AST nodes to/from their corresponding definition nodes. It is useful in tools that perform JavaScript source introspection.
For example, suppose we have the following code.
function a(b) {
var c = 1, d;
}defnode maps the following Identifier/definition pairs:
ato/from the enclosing FunctionDeclaration nodebto/from itself (since its Identifier node is its own declaration)cto/from its VariableDeclarator nodedto/from its VariableDeclarator node
defnode uses marijnh/tern, but it should work with any SpiderMonkey API-compliant JavaScript AST.
Documentation: defnode.js on Sourcegraph
Running tests
Run npm test.
Contributors
- Quinn Slack sqs@sourcegraph.com




