{"_id":"ast-parents","_rev":"92680","name":"ast-parents","description":"Walks a JavaScript AST and adds a \"parent\" property to each node","dist-tags":{"latest":"0.0.1"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"time":{"modified":"2021-06-03T10:30:42.000Z","created":"2014-02-04T09:04:03.774Z","0.0.1":"2014-02-04T09:16:45.270Z","0.0.0":"2014-02-04T09:04:03.774Z"},"users":{},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"repository":{"type":"git","url":"git://github.com/hughsk/ast-parents"},"versions":{"0.0.1":{"name":"ast-parents","description":"Walks a JavaScript AST and adds a \"parent\" property to each node","version":"0.0.1","main":"index.js","browser":"index.js","dependencies":{},"devDependencies":{},"scripts":{},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/ast-parents"},"bugs":{"url":"https://github.com/hughsk/ast-parents/issues"},"homepage":"https://github.com/hughsk/ast-parents","keywords":["ast","walk","parents","node","syntax","parse"],"_id":"ast-parents@0.0.1","dist":{"shasum":"508fd0f05d0c48775d9eccda2e174423261e8dd3","size":2043,"noattachment":false,"key":"/ast-parents/-/ast-parents-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ast-parents/download/ast-parents-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"publish_time":1391505405270,"_hasShrinkwrap":false,"_cnpm_publish_time":1391505405270},"0.0.0":{"name":"ast-parents","description":"Walks a JavaScript AST and adds a \"parent\" property to each node","version":"0.0.0","main":"index.js","browser":"index.js","dependencies":{},"devDependencies":{},"scripts":{},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/ast-parents"},"bugs":{"url":"https://github.com/hughsk/ast-parents/issues"},"homepage":"https://github.com/hughsk/ast-parents","keywords":["ast","walk","parents","node","syntax","parse"],"_id":"ast-parents@0.0.0","dist":{"shasum":"fbb9937d39c003b7432d03ca3d7cb11d7f145c60","size":2040,"noattachment":false,"key":"/ast-parents/-/ast-parents-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ast-parents/download/ast-parents-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"publish_time":1391504643774,"_hasShrinkwrap":false,"_cnpm_publish_time":1391504643774}},"readme":"# ast-parents [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/ast-parents&title=ast-parents&description=hughsk/ast-parents%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #\n\nWalks a JavaScript AST, such as one supplied via\n[esprima](http://github.com/ariya/esprima), and adds a `parent`\nproperty to each node.\n\nMakes it much easier to navigate the AST, and the `parent` properties\nadded here are non-enumerable so you can still serialize the tree to JSON\nwithout `JSON.stringify` throwing an error.\n\n## Usage ##\n\n[![ast-parents](https://nodei.co/npm/ast-parents.png?mini=true)](https://nodei.co/npm/ast-parents)\n\n`require('ast-parents')(ast)`\n\nWhere `ast` is an AST object. For example:\n\n``` javascript\nvar esprima = require('esprima')\nvar fs = require('fs')\n\nvar src = fs.readFileSync(__filename, 'utf8')\nvar ast = esprima.parse(src)\n\nparents(ast)\n\nast.body[0].parent === ast.body\n```\n\n## License ##\n\nMIT. See [LICENSE.md](http://github.com/hughsk/ast-parents/blob/master/LICENSE.md) for details.\n","_attachments":{},"homepage":"https://github.com/hughsk/ast-parents","bugs":{"url":"https://github.com/hughsk/ast-parents/issues"},"license":"MIT"}