{"_id":"rocambole","_rev":"160848","name":"rocambole","description":"Recursively walk and transform EcmaScript AST","dist-tags":{"latest":"0.7.0"},"maintainers":[{"name":"millermedeiros","email":""}],"time":{"modified":"2021-06-03T11:40:05.000Z","created":"2012-12-06T23:41:27.658Z","0.7.0":"2015-08-26T21:07:06.952Z","0.6.0":"2015-03-31T01:03:09.925Z","0.5.1":"2015-03-19T16:34:07.945Z","0.5.0":"2015-02-26T01:17:04.239Z","0.3.6":"2014-06-23T22:09:19.686Z","0.3.5":"2014-06-23T21:40:10.939Z","0.3.4":"2014-06-23T21:18:31.048Z","0.3.3":"2014-04-26T10:24:54.723Z","0.3.2":"2014-01-17T16:51:14.420Z","0.3.1":"2013-12-15T04:11:59.069Z","0.3.0":"2013-12-15T03:42:35.361Z","0.2.3":"2013-01-09T00:36:41.276Z","0.2.2":"2012-12-19T02:50:40.794Z","0.2.1":"2012-12-13T13:59:19.787Z","0.2.0":"2012-12-09T03:19:20.745Z","0.1.1":"2012-12-08T05:22:58.882Z","0.1.0":"2012-12-06T23:41:27.658Z"},"users":{"millermedeiros":true},"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"repository":{"type":"git","url":"git+https://github.com/millermedeiros/rocambole.git"},"versions":{"0.7.0":{"name":"rocambole","version":"0.7.0","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"git+https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"^2.1"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"gitHead":"e2c69432a322d94e88b4f18417d65f6800d8dc7c","homepage":"https://github.com/millermedeiros/rocambole#readme","_id":"rocambole@0.7.0","_shasum":"f6c79505517dc42b6fb840842b8b953b0f968585","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"dist":{"shasum":"f6c79505517dc42b6fb840842b8b953b0f968585","size":184552,"noattachment":false,"key":"/rocambole/-/rocambole-0.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.7.0.tgz"},"publish_time":1440623226952,"_cnpm_publish_time":1440623226952,"_hasShrinkwrap":false},"0.6.0":{"name":"rocambole","version":"0.6.0","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"^2.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"gitHead":"a3d0d63d58b769d13bad288aca32c6e2f7766542","homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.6.0","_shasum":"534f235a287cc17f9b057b95bd11d0f0dc35452c","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"dist":{"shasum":"534f235a287cc17f9b057b95bd11d0f0dc35452c","size":184446,"noattachment":false,"key":"/rocambole/-/rocambole-0.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.6.0.tgz"},"publish_time":1427763789925,"_cnpm_publish_time":1427763789925,"_hasShrinkwrap":false},"0.5.1":{"name":"rocambole","version":"0.5.1","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"^2.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"gitHead":"56c34ad8b1e699e3d8e83aaf84cc6f95cd6e0473","homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.5.1","_shasum":"3048f64b2388b8dd8e933f9ad443f0b389ab608f","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"dist":{"shasum":"3048f64b2388b8dd8e933f9ad443f0b389ab608f","size":183617,"noattachment":false,"key":"/rocambole/-/rocambole-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.5.1.tgz"},"publish_time":1426782847945,"_cnpm_publish_time":1426782847945,"_hasShrinkwrap":false},"0.5.0":{"name":"rocambole","version":"0.5.0","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"^2.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"gitHead":"93be52fca355131db2916417918507d0f9fc39a7","homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.5.0","_shasum":"3585db726a98ff82e20c1c3c2c435040fc58b66b","_from":".","_npmVersion":"2.1.11","_nodeVersion":"0.10.29","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"dist":{"shasum":"3585db726a98ff82e20c1c3c2c435040fc58b66b","size":183480,"noattachment":false,"key":"/rocambole/-/rocambole-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.5.0.tgz"},"publish_time":1424913424239,"_cnpm_publish_time":1424913424239,"_hasShrinkwrap":false},"0.3.6":{"name":"rocambole","version":"0.3.6","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.3.6","dist":{"shasum":"4debbf5943144bc7b6006d95be8facc0b74352a7","size":183294,"noattachment":false,"key":"/rocambole/-/rocambole-0.3.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.3.6.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1403561359686,"_cnpm_publish_time":1403561359686,"_hasShrinkwrap":false},"0.3.5":{"name":"rocambole","version":"0.3.5","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.3.5","dist":{"shasum":"0e0a4d37b28c0aee73cb09c77e105e20a0d4e044","size":183249,"noattachment":false,"key":"/rocambole/-/rocambole-0.3.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.3.5.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1403559610939,"_cnpm_publish_time":1403559610939,"_hasShrinkwrap":false},"0.3.4":{"name":"rocambole","version":"0.3.4","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.3.4","dist":{"shasum":"e243aaccc88602d5371ac13a910b81aec1b59a09","size":182983,"noattachment":false,"key":"/rocambole/-/rocambole-0.3.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.3.4.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1403558311048,"_cnpm_publish_time":1403558311048,"_hasShrinkwrap":false},"0.3.3":{"name":"rocambole","version":"0.3.3","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.3.3","dist":{"shasum":"2fd89b64f19aa597bc4155ddb5ff5836ccf277ee","size":182924,"noattachment":false,"key":"/rocambole/-/rocambole-0.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.3.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1398507894723,"_cnpm_publish_time":1398507894723,"_hasShrinkwrap":false},"0.3.2":{"name":"rocambole","version":"0.3.2","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"readmeFilename":"README.md","homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.3.2","dist":{"shasum":"315bdf05f49126191b11a01eb4d9134fbefa62ed","size":182834,"noattachment":false,"key":"/rocambole/-/rocambole-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.3.2.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1389977474420,"_cnpm_publish_time":1389977474420,"_hasShrinkwrap":false},"0.3.1":{"name":"rocambole","version":"0.3.1","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"readmeFilename":"README.md","homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.3.1","dist":{"shasum":"b3f7fa6bfca22dae0940947fc7d4f595b972b395","size":182366,"noattachment":false,"key":"/rocambole/-/rocambole-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.3.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1387080719069,"_cnpm_publish_time":1387080719069,"_hasShrinkwrap":false},"0.3.0":{"name":"rocambole","version":"0.3.0","description":"Recursively walk and transform EcmaScript AST","main":"rocambole.js","directories":{"test":"test"},"scripts":{"test":"istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0"},"devDependencies":{"mocha":"~1.7","expect.js":"0.2","istanbul":"~0.1.23"},"readmeFilename":"README.md","homepage":"https://github.com/millermedeiros/rocambole","_id":"rocambole@0.3.0","dist":{"shasum":"fa2b3140e7791d404d622415fc30ca25aabd99a0","size":182305,"noattachment":false,"key":"/rocambole/-/rocambole-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.3.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"millermedeiros","email":"miller@millermedeiros.com"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1387078955361,"_cnpm_publish_time":1387078955361,"_hasShrinkwrap":false},"0.2.3":{"name":"rocambole","version":"0.2.3","description":"Recursively walk and transform EcmaScript AST","main":"lib/walker.js","directories":{"test":"test"},"scripts":{"test":"node ./node_modules/.bin/istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0.2"},"devDependencies":{"mocha":"1.7","expect.js":"0.2","istanbul":"~0.1.23"},"_id":"rocambole@0.2.3","dist":{"shasum":"a4c120e422e3cf8706af79c1eb4eb51f589b3005","size":181877,"noattachment":false,"key":"/rocambole/-/rocambole-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.2.3.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1357691801276,"_cnpm_publish_time":1357691801276,"_hasShrinkwrap":false},"0.2.2":{"name":"rocambole","version":"0.2.2","description":"Recursively walk and transform EcmaScript AST","main":"lib/walker.js","directories":{"test":"test"},"scripts":{"test":"node ./node_modules/.bin/istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0.2"},"devDependencies":{"mocha":"1.7","expect.js":"0.2","istanbul":"~0.1.23"},"_id":"rocambole@0.2.2","dist":{"shasum":"f809f31cf4038906bd7898d91566ffb53dbc39c3","size":95530,"noattachment":false,"key":"/rocambole/-/rocambole-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.2.2.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1355885440794,"_cnpm_publish_time":1355885440794,"_hasShrinkwrap":false},"0.2.1":{"name":"rocambole","version":"0.2.1","description":"Recursively walk and transform EcmaScript AST","main":"lib/walker.js","directories":{"test":"test"},"scripts":{"test":"node ./node_modules/.bin/istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0.2"},"devDependencies":{"mocha":"1.7","expect.js":"0.2","istanbul":"~0.1.23"},"_id":"rocambole@0.2.1","dist":{"shasum":"2fbb2dfffd09af55a8deef6601f741749fb9e7ac","size":95017,"noattachment":false,"key":"/rocambole/-/rocambole-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.2.1.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1355407159787,"_cnpm_publish_time":1355407159787,"_hasShrinkwrap":false},"0.2.0":{"name":"rocambole","version":"0.2.0","description":"Recursively walk and transform EcmaScript AST","main":"lib/walker.js","directories":{"test":"test"},"scripts":{"test":"node ./node_modules/.bin/istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0.2"},"devDependencies":{"mocha":"1.7","expect.js":"0.2","istanbul":"~0.1.23"},"_id":"rocambole@0.2.0","dist":{"shasum":"b79b3ea5f9936dd243e9f7fe25373349ad7b4202","size":93119,"noattachment":false,"key":"/rocambole/-/rocambole-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.2.0.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1355023160745,"_cnpm_publish_time":1355023160745,"_hasShrinkwrap":false},"0.1.1":{"name":"rocambole","version":"0.1.1","description":"Recursively walk and transform EcmaScript AST","main":"lib/walker.js","directories":{"test":"test"},"scripts":{"test":"node ./node_modules/.bin/istanbul test test/runner.js"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0.2","amd-utils":"~0.8.1"},"devDependencies":{"mocha":"1.7","expect.js":"0.2","istanbul":"~0.1.23"},"_id":"rocambole@0.1.1","dist":{"shasum":"e21e42784a8c666f98a5a9e77579e7f4a2f7960b","size":94414,"noattachment":false,"key":"/rocambole/-/rocambole-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.1.1.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1354944178882,"_cnpm_publish_time":1354944178882,"_hasShrinkwrap":false},"0.1.0":{"name":"rocambole","version":"0.1.0","description":"Recursively walk and transform EcmaScript AST","main":"lib/walker.js","directories":{"test":"test"},"scripts":{"test":"node ./node_modules/.bin/jasmine-node test"},"repository":{"type":"git","url":"https://github.com/millermedeiros/rocambole.git"},"bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"keywords":["ast","walk","syntax","source","tree","traversal","falafel","burrito","esprima"],"author":{"name":"Miller Medeiros","email":"http://blog.millermedeiros.com"},"license":"MIT","dependencies":{"esprima":"~1.0.2","amd-utils":"~0.8.1"},"devDependencies":{"jasmine-node":"~1.0.26"},"_id":"rocambole@0.1.0","dist":{"shasum":"ef55aeb46f43a395ee7a201901f79c354adcb014","size":6657,"noattachment":false,"key":"/rocambole/-/rocambole-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rocambole/download/rocambole-0.1.0.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1354837287658,"_cnpm_publish_time":1354837287658,"_hasShrinkwrap":false}},"readme":"# Rocambole [![Build Status](https://secure.travis-ci.org/millermedeiros/rocambole.svg?branch=master)](https://travis-ci.org/millermedeiros/rocambole)\n\n![rocambole](https://raw.github.com/millermedeiros/rocambole/master/rocambole.jpg)\n\nRecursively walk and add extra information/helpers to [Esprima / Mozilla\nSpiderMonkey Parser API](http://esprima.org/doc/index.html#ast) compatible AST.\n\nThe main difference between other tools is that it also keeps information about\ntokens and white spaces and it is meant to be used to transform the tokens and\nnot the string values itself.\n\nThis library is specially useful for non-destructive AST manipulation.\n\n\n## Inspiration\n\nThis module was heavily inspired by\n[node-falafel](https://github.com/substack/node-falafel) and\n[node-burrito](https://github.com/substack/node-burrito) but I needed more\ninformation than what is currently available on falafel (specially about\ntokens, empty lines and white spaces) and also needed to do the node traversing\non the opposite order (start from leaf nodes). The amount of changes required\nto introduce the new features and the differences on the concept behind the\ntool justified a new project.\n\nIt was created mainly to be used on\n[esformatter](https://github.com/millermedeiros/esformatter/).\n\n\n\n## Extra Tokens\n\nBesides all the regular tokens returned by `esprima` we also add a few more\nthat are important for non-destructive transformations:\n\n * `WhiteSpace`\n   - Can store multiple white spaces (tabs are considered white space, line\n     breaks not). Important if you want to do non-destructive replacements that\n     are white-space sensitive.\n   - Multiple subsequent white spaces are treated as a single token.\n * `LineBreak`\n * `LineComment`\n * `BlockComment`\n\nIt's way easier to rebuild the JS string if the tokens already have line breaks\nand comments. It's also easier to identify if previous/next/current token is a\nLineBreak or Comment (sometimes needed for non-destructive transformations).\n\nRocambole structure might change in the future to keep the extraneous tokens\noutside the `tokens` array and also add an option to toggle the behavior.\n([issue #7](https://github.com/millermedeiros/rocambole/issues/7))\n\n\n## Extra Properties\n\nEach Node have the following extra properties/methods:\n\n  - `parent` : Node|undefined\n  - `toString()` : string\n  - `next` : Node|undefined\n  - `prev` : Node|undefined\n  - `depth` : Number\n  - `startToken` : Token\n  - `endToken` : Token\n\nEach token also have:\n\n - `prev` : Token|undefined\n - `next` : Token|undefined\n\nBlockComment also have:\n\n  - `originalIndent`: String|undefined\n\nTo get a better idea of the generated AST structure try out\n[rocambole-visualize](http://piuccio.github.io/rocambole-visualize/).\n\n\n## Linked List\n\nYou should **treat the tokens as a linked list instead of reading the\n`ast.tokens` array** (inserting/removing items from a linked list is very cheap\nand won't break the loop). You should grab a reference to the `node.startToken`\nand get `token.next` until you find the desired token or reach the end of the\nprogram. To loop between all tokens inside a node you can do like this:\n\n```js\nvar token = node.startToken;\nwhile (token !== node.endToken.next) {\n    doStuffWithToken(token);\n    token = token.next;\n}\n```\n\nThe method `toString` loops through all tokens between `node.startToken` and\n`node.endToken` grabbing the `token.raw` (used by comments) or `token.value`\nproperties. To implement a method similar to falafel `update()` you can do\nthis:\n\n```js\nfunction update(node, str){\n    var newToken = {\n        type : 'Custom', // can be anything (not used internally)\n        value : str\n    };\n    // update linked list references\n    if ( node.startToken.prev ) {\n        node.startToken.prev.next = newToken;\n        newToken.prev = node.startToken.prev;\n    }\n    if ( node.endToken.next ) {\n        node.endToken.next.prev = newToken;\n        newToken.next = node.endToken.next;\n    }\n    node.startToken = node.endToken = newToken;\n}\n```\n\n\n## Helpers\n\nI plan to create helpers as separate projects when possible.\n\n - [rocambole-token](https://github.com/millermedeiros/rocambole-token): helpers for token manipulation/traversal\n - [rocambole-node](https://github.com/millermedeiros/rocambole-node): helpers for node manipulation/traversal\n - [rocambole-whitespace](https://github.com/millermedeiros/rocambole-whitespace): helpers for whitespace manipulation\n - [rocambole-linebreak](https://github.com/millermedeiros/rocambole-linebreak): helpers for line break manipulation\n - [rocambole-indent](https://github.com/millermedeiros/rocambole-indent): helpers for indentation\n\n\n## API\n\n\n### rocambole.parse(source, [opts])\n\nParses a string and instrument the AST with extra properties/methods.\n\n```js\nvar rocambole = require('rocambole');\nvar ast = rocambole.parse(string);\nconsole.log( ast.startToken );\n// to get a string representation of all tokens call toString()\nconsole.log( ast.toString() );\n```\n\nYou can pass custom options as the second argument:\n\n```js\nrocambole.parse(source, {\n    loc: true,\n    // custom options are forwarded to the rocambole.parseFn\n    ecmaFeatures: {\n        arrowFunctions: true\n    }\n});\n```\n\n**IMPORTANT:** rocambole needs the `range`, `tokens` and `comment` info to\nbuild the token linked list, so these options will always be set to `true`.\n\n### rocambole.parseFn:Function\n\nAllows you to override the function used to parse the program. Defaults to\n`esprima.parse`.\n\n```js\n// espree is compatible with esprima AST so things should work as expected\nvar espree = require('espree');\nrocambole.parseFn = espree.parse;\nrocambole.parseContext = espree;\n```\n\n### rocambole.parseContext:Object\n\nSets the context (`this` value) of the `parseFn`. Defaults to `esprima`.\n\n### rocambole.parseOptions:Object\n\nSets the default options passed to `parseFn`.\n\n```js\n// default values\nrocambole.parseOptions = {\n    // we need range/tokens/comment info to build the tokens linked list!\n    range: true,\n    tokens: true,\n    comment: true\n};\n```\n\n### rocambole.moonwalk(ast, callback)\n\nThe `moonwalk()` starts at the leaf nodes and go down the tree until it reaches\nthe root node (`Program`). Each node will be traversed only once.\n\n```js\nrocambole.moonwalk(ast, function(node){\n    if (node.type == 'ArrayExpression'){\n        console.log( node.depth +': '+ node.toString() );\n    }\n});\n```\n\nTraverse order:\n\n```\n Program [#18]\n `-FunctionDeclaration [#16]\n   |-BlockStatement [#14]\n   | |-IfStatement [#12]\n   | | |-BynaryExpression [#9]\n   | | | |-Identifier [#4]\n   | | | `-Literal [#5]\n   | | `-BlockStatement [#10]\n   | |   `-ExpressionStatement [#6]\n   | |     `-AssignmentExpression [#3]\n   | |       |-Identifier [#1 walk starts here]\n   | |       `-Literal [#2]\n   | `-VariableDeclaration [#13]\n   |   `-VariableDeclarator [#11]\n   |     |-Identifier [#7]\n   |     `-Literal [#8]\n   `-ReturnStatement [#17]\n     `-Identifier [#15]\n```\n\nThis behavior is very different from node-falafel and node-burrito.\n\n\n### rocambole.walk(ast, callback)\n\nIt loops through all nodes on the AST starting from the root node (`Program`),\nsimilar to `node-falafel`.\n\n```js\nrocambole.walk(ast, function(node){\n    console.log(node.type);\n});\n```\n\n\n## Popular Alternatives\n\n - [burrito](https://github.com/substack/node-burrito)\n - [falafel](https://github.com/substack/node-falafel)\n\n\n\n## Unit Tests\n\nBesides the regular unit tests we also use\n[istanbul](https://github.com/yahoo/istanbul) to generate code coverage\nreports, tests should have at least 95% code coverage for statements, branches\nand lines and 100% code coverage for functions or travis build will fail.\n\nWe do not run the coverage test at each call since it slows down the\nperformnace of the tests and it also makes it harder to see the test results.\nTo execute tests and generate coverage report call `npm test --coverage`, for\nregular tests just do `npm test`.\n\nCoverage reports are not committed to the repository since they will change at\neach `npm test --coverage` call.\n\n\n\n## License\n\nMIT\n\n","_attachments":{},"homepage":"https://github.com/millermedeiros/rocambole#readme","bugs":{"url":"https://github.com/millermedeiros/rocambole/issues"},"license":"MIT"}