README
lively.ast 
Parsing JS code into ASTs and tools to query and transform these trees.
API
main interface
ast.printAstast.compareAstast.pathToNodeast.stringifyast.parseast.parseFunctionast.fuzzyParseast.nodesAtast.withMozillaAstDo
Visitors
ast.MozillaAST.BaseVisitorast.MozillaAST.PrinterVisitorast.MozillaAST.ComparisonVisitorast.MozillaAST.ScopeVisitor
query ast nodes
ast.query.knownGlobalsast.query.scopesast.query.nodesAtIndexast.query.scopesAtIndexast.query.scopeAtIndexast.query.scopesAtPosast.query.nodesInScopeOfast.query.topLevelDeclsAndRefsast.query.findGlobalVarRefsast.query.findNodesIncludingLinesast.query.findReferencesAndDeclsInScopeast.query.findDeclarationClosestToIndex
transform asts
ast.transform.replaceast.transform.replaceTopLevelVarDeclAndUsageForCapturingast.transform.oneDeclaratorPerVarDeclast.transform.oneDeclaratorForVarsInDestructoringast.transform.returnLastStatementast.transform.wrapInFunction
comment parsing
ast.comments.extractComments
code categorizer, scan code for known constructs
ast.codeCategorizer.findDecls
Usage
node.js
var ast = require('lively.ast'),
parsed = ast.parse("1 + 2");
ast.printAst(parsed);
// =>
// :Program
// \-.body[0]:ExpressionStatement
// \-.body[0].expression:BinaryExpression
// |-.body[0].expression.left:Literal
// \-.body[0].expression.right:Literal
...
browser
HTML: <script src="dist/lively.ast.bundle.js"></script>
JS: like above
Development
build dist
npm run build
Testing
npm test
LICENSE
MIT