walkall

0.0.5 • Public • Published

acorn-walkall

xrefs Most used function Number of funcs Status

acorn-walkall provides a custom walker for Marijn Haverbeke's acorn JavaScript parser that traverses all AST nodes.

Documentation: acorn-walkall on Sourcegraph

Usage

var acorn = require('acorn'),
    walk = require('acorn/util/walk'),
    walkall = require('./walkall');
var ast = acorn.parse('var x = 7;');
walk.simple(ast, walkall.makeVisitors(function(node) {
  console.log('Found node type', node.type);
}), walkall.traversers);

The included bin/walkall script emits the AST node type and source location for each AST node in the specified JavaScript file.

Running tests

Run npm test.

Author

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.5
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.5
    6
  • 0.0.3
    1
  • 0.0.2
    1
  • 0.0.1
    0

Package Sidebar

Install

npm i walkall

Weekly Downloads

8

Version

0.0.5

License

none

Last publish

Collaborators

  • sqs