{"_id":"estree-walk","_rev":"112825","name":"estree-walk","description":"Walk ESTree nodes simple and fast","dist-tags":{"latest":"2.2.0"},"maintainers":[{"name":"jamen","email":""}],"time":{"modified":"2021-06-03T10:45:11.000Z","created":"2016-12-04T19:07:09.204Z","2.2.0":"2017-08-05T20:06:21.141Z","2.1.0":"2017-08-04T22:43:35.014Z","1.1.0":"2017-08-04T20:13:32.161Z","1.0.0":"2017-01-07T22:13:43.851Z","0.3.2":"2017-01-07T11:05:55.004Z","0.3.1":"2017-01-07T10:40:10.961Z","0.3.0":"2017-01-07T10:32:05.739Z","0.2.2":"2016-12-08T06:57:49.403Z","0.2.1":"2016-12-08T06:17:53.782Z","0.2.0":"2016-12-08T05:46:36.985Z","0.1.1":"2016-12-05T20:51:35.930Z","0.1.0":"2016-12-05T19:57:35.007Z","0.0.0":"2016-12-04T19:07:09.204Z"},"users":{},"author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"versions":{"2.2.0":{"name":"estree-walk","description":"Walk ESTree nodes simple and fast","version":"2.2.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"tape 'test/*.js'"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"devDependencies":{"babylon":"^6.14.1","benchmark":"^2.1.3","espree":"^3.5.0","esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"5b991f4e33789b1fc5246d971a9d645354b8e799","_id":"estree-walk@2.2.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"f1428cbdb57f46462be9f0d5d2fa5582e647dad9","size":2736,"noattachment":false,"key":"/estree-walk/-/estree-walk-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-2.2.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/estree-walk-2.2.0.tgz_1501963580193_0.866254088236019"},"directories":{},"publish_time":1501963581141,"_hasShrinkwrap":false,"_cnpm_publish_time":1501963581141},"2.1.0":{"name":"estree-walk","description":"Walk ESTree nodes simple and fast","version":"2.1.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"tape 'test/*.js'"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"devDependencies":{"babylon":"^6.14.1","benchmark":"^2.1.3","esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"de8c8ce0c033c7c941643776cc9dec8177e9e8d7","_id":"estree-walk@2.1.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"0b4408098f1ee93d0987bb8a2c9b7d76005105a1","size":2659,"noattachment":false,"key":"/estree-walk/-/estree-walk-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-2.1.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/estree-walk-2.1.0.tgz_1501886614133_0.0027214493602514267"},"directories":{},"publish_time":1501886615014,"_hasShrinkwrap":false,"_cnpm_publish_time":1501886615014,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"1.1.0":{"name":"estree-walk","description":"Walk ESTree nodes simple and fast","version":"1.1.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"tape 'test/*.js'"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"babylon":"^6.14.1","benchmark":"^2.1.3","esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"e4e6e13c62d4a6397dec511a2aad8901322f0f13","_id":"estree-walk@1.1.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"7b0cc2e18c1db24fa509b291dadc45dc27752ae2","size":3404,"noattachment":false,"key":"/estree-walk/-/estree-walk-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-1.1.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/estree-walk-1.1.0.tgz_1501877610635_0.09735901677049696"},"directories":{},"publish_time":1501877612161,"_hasShrinkwrap":false,"_cnpm_publish_time":1501877612161,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"1.0.0":{"name":"estree-walk","description":"Walk ESTree nodes simple and fast","version":"1.0.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"tape 'test/*.js'"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"babylon":"^6.14.1","benchmark":"^2.1.3","esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"1c7993393c07168b9a794aa752278cebb064b1d3","_id":"estree-walk@1.0.0","_shasum":"9db3c0ead87ff5675d767815b9247325c3d3f60f","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"9db3c0ead87ff5675d767815b9247325c3d3f60f","size":3420,"noattachment":false,"key":"/estree-walk/-/estree-walk-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-1.0.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/estree-walk-1.0.0.tgz_1483827223156_0.8775201337412"},"directories":{},"publish_time":1483827223851,"_cnpm_publish_time":1483827223851,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.3.2":{"name":"estree-walk","description":"Walk ESTree nodes simple and fast","version":"0.3.2","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"benchmark":"^2.1.3","esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"0fffae522e43c5d6b7fe9352cb2b0b2e3f16125c","_id":"estree-walk@0.3.2","_shasum":"c68bbfaa839e8828e9e4902e77b4316685197a8f","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"c68bbfaa839e8828e9e4902e77b4316685197a8f","size":3168,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.3.2.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/estree-walk-0.3.2.tgz_1483787154303_0.07401095051318407"},"directories":{},"publish_time":1483787155004,"_cnpm_publish_time":1483787155004,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.3.1":{"name":"estree-walk","description":"Walk ESTree nodes simple and fast","version":"0.3.1","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"9c3dcffd6ebb5302efd043157d8615fc5efc8e7f","_id":"estree-walk@0.3.1","_shasum":"d94b7faf2a074bfe0900a0128f054f4842f21f8e","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"d94b7faf2a074bfe0900a0128f054f4842f21f8e","size":3226,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.3.1.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/estree-walk-0.3.1.tgz_1483785608734_0.7938337381929159"},"directories":{},"publish_time":1483785610961,"_cnpm_publish_time":1483785610961,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.3.0":{"name":"estree-walk","description":"Walk ESTree nodes simple and fast","version":"0.3.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"f0e3bf1c8077f41c57f8d5b7c34984bfe634c314","_id":"estree-walk@0.3.0","_shasum":"6e73224498d58d135ae87699768aa70df0e669d7","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"6e73224498d58d135ae87699768aa70df0e669d7","size":3204,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.3.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/estree-walk-0.3.0.tgz_1483785123572_0.25047334702685475"},"directories":{},"publish_time":1483785125739,"_cnpm_publish_time":1483785125739,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.2.2":{"name":"estree-walk","description":"Simple and fast Estree walking.","version":"0.2.2","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"files":["index.js"],"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"866eb5c0a868e01a0e513fdba4b62b526c189817","_id":"estree-walk@0.2.2","_shasum":"dd168c8f9938cd734990a780cc40a91ac22ae245","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"dd168c8f9938cd734990a780cc40a91ac22ae245","size":2937,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.2.2.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/estree-walk-0.2.2.tgz_1481180268803_0.5969643413554877"},"directories":{},"publish_time":1481180269403,"_cnpm_publish_time":1481180269403,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.2.1":{"name":"estree-walk","description":"Simple and fast Estree walking.","version":"0.2.1","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"67b4ba5b1631057583925b0c67188e1c412ac961","_id":"estree-walk@0.2.1","_shasum":"5a2bf218cf854707acba7edeb4398730dde55f41","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"5a2bf218cf854707acba7edeb4398730dde55f41","size":4486,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.2.1.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/estree-walk-0.2.1.tgz_1481177873221_0.41817137179896235"},"directories":{},"publish_time":1481177873782,"_cnpm_publish_time":1481177873782,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.2.0":{"name":"estree-walk","description":"Simple and fast Estree walking.","version":"0.2.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"7613ba4e70ad31221c1fd53916b3d25fdb8c2725","_id":"estree-walk@0.2.0","_shasum":"7582a36567524fcab6d78219b206ff0269479c08","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"7582a36567524fcab6d78219b206ff0269479c08","size":4494,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.2.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/estree-walk-0.2.0.tgz_1481175996432_0.8724902600515634"},"directories":{},"publish_time":1481175996985,"_cnpm_publish_time":1481175996985,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.1.1":{"name":"estree-walk","description":"Simple and fast Estree walking.","version":"0.1.1","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"d8b915d1c0f93fd2d95c812d1fff8bd45b7bb36b","_id":"estree-walk@0.1.1","_shasum":"7e71a69b5e0857116e43c25e248b549a6375996b","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"7e71a69b5e0857116e43c25e248b549a6375996b","size":3598,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.1.1.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/estree-walk-0.1.1.tgz_1480971095385_0.8779381217900664"},"directories":{},"publish_time":1480971095930,"_cnpm_publish_time":1480971095930,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.1.0":{"name":"estree-walk","description":"Simple and fast Estree walking.","version":"0.1.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"10c5aa313ee85d80d6f1f226a4a1839b7fbc0bf0","_id":"estree-walk@0.1.0","_shasum":"afb125e191acc3ce6690761454216aecbb036d38","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"afb125e191acc3ce6690761454216aecbb036d38","size":3296,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.1.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/estree-walk-0.1.0.tgz_1480967853093_0.4729834534227848"},"directories":{},"publish_time":1480967855007,"_cnpm_publish_time":1480967855007,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."},"0.0.0":{"name":"estree-walk","description":"Simple and fast Estree walking.","version":"0.0.0","homepage":"https://github.com/jamen/estree-walk","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/estree-walk.git"},"bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT","engines":{"node":">=4"},"scripts":{"test":"node test"},"keywords":["estree","esprima","walk","jamen"],"dependencies":{"free-context":"0.0.0"},"devDependencies":{"esprima":"^3.1.2","tape":"^4.6.3"},"gitHead":"5330724d6b0ddca2eaa7802bb51b2a153754bcbf","_id":"estree-walk@0.0.0","_shasum":"c80198bbc71535ae460f51535d1ffc3aff3461b7","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"c80198bbc71535ae460f51535d1ffc3aff3461b7","size":2921,"noattachment":false,"key":"/estree-walk/-/estree-walk-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/estree-walk/download/estree-walk-0.0.0.tgz"},"maintainers":[{"name":"jamen","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/estree-walk-0.0.0.tgz_1480878427171_0.4520376021973789"},"directories":{},"publish_time":1480878429204,"_cnpm_publish_time":1480878429204,"_hasShrinkwrap":false,"deprecated":"No longer maintained. Please use estree-walker or estraverse instead."}},"readme":"# estree-walk\n\n> Walk ESTree nodes simple and fast\n\n```js\n// Walk tree with a visitor\nwalk(source, {\n  ReturnStatement: function (node, stop) {\n    // You can call `stop` to exit the walking\n  }\n})\n\n// Walk tree with a fast alrenative:\nfor (var q = [source], node; node = q.pop(); walk.step(node, q)) {\n  switch (node.type) {\n    // ...\n  }\n}\n```\n\nFunctions for walking [ESTree](https://github.com/estree/estree) nodes.  Like others, it attempts to stay future-proof by enumerating the node's keys instead of handling the node's type, while also providing simple usage.\n\n## Installation\n\n```sh\nnpm i estree-walk\n```\n\n## Usage\n\nThere is two methods of walking trees with this library:\n\n 1. Using a visitor pattern with `walk(node, visitor)`\n 2. Using a looping pattern with `walk.step(node, queue)`\n\n### `walk(node, visitor)`\n\nWalks a node tree using a visitor.  A visitor can be a function that executes for all nodes, or an object of functions that execute for a given node type.  Visitor functions have the signature `(node, stop?)`, where `stop` can be called to exit quickly.\n\n```js\n// Visit by node type\nwalk(node, {\n  FunctionDeclaration: function (node) {\n    console.log(node.id)\n  },\n\n  ImportDeclaration: function (node, stop) {\n    if (isRelative(node.source.value)) {\n      // Exit walking quickly with stop\n      stop()\n    }\n  }\n})\n\n// Visit all nodes\nwalk(node, function (node) {\n  console.log(node.type, node.loc)\n})\n```\n\n### `walk.step(node, queue)`\n\nAn alternative to the visitor pattern is using a loop, which can provide a much faster way to walk trees, but at the price of extra maintence.  The `step` function simply scans `node` for possible child nodes, and pushes them onto `queue`.  This can be used with a loop to walk the tree:\n\n```js\n// Start loop with a source node:\nfor (var queue = [mainNode]; queue.length;) {\n  var node = queue.pop()\n  // handle `node` with a switch statement or whatever\n  // then continue walking using step function:\n  walk.step(node, queue)\n}\n```\n\nThis method is _much_ faster than a visitor pattern at the cost of less understandable code (as it is used internally to create the visitors).  The visitor pattern is likely fast enough for most cases where it is preferred over this.\n\n## License\n\nMIT © [Jamen Marz](https://git.io/jamen)\n\n---\n\n[![version](https://img.shields.io/npm/v/estree-walk.svg?style=flat-square)][package] [![travis](https://img.shields.io/travis/jamen/estree-walk.svg?style=flat-square)](https://travis-ci.org/jamen/estree-walk) [![downloads](https://img.shields.io/npm/dt/estree-walk.svg?style=flat-square)][package] [![license](https://img.shields.io/npm/l/estree-walk.svg?style=flat-square)][package] [![follow](https://img.shields.io/github/followers/jamen.svg?style=social&label=Follow)](https://github.com/jamen)\n\n[package]: https://npmjs.org/package/estree-walk\n","_attachments":{},"homepage":"https://github.com/jamen/estree-walk","bugs":{"url":"https://github.com/jamen/estree-walk/issues"},"license":"MIT"}