{"name":"ast-children","version":"1.0.5","description":"get the children of an AST node","keywords":["ast","children"],"main":"built.js","dependencies":{},"devDependencies":{"assert":"github:jkroso/assert","serve":"github:jkroso/serve","match":"github:jkroso/match","hydro-bdd":"*","hydro-html":"*","hydro-dot":"*","esprima":"*","hydro":"*"},"transpile":[["index.js","!sourcegraph/babel->js"],["keys.json","!sourcegraph/json->js"]],"scripts":{"prepublish":"babel index.js > built.js"},"repository":{"type":"git","url":"git://github.com/jkroso/ast-children.git"},"author":{"name":"Jake Rosoman"},"files":["index.js","keys.json","built.js"],"license":"MIT","gitHead":"c4fa207f520e207cd2e0a6bf1d25d411ae149f8e","bugs":{"url":"https://github.com/jkroso/ast-children/issues"},"homepage":"https://github.com/jkroso/ast-children#readme","_id":"ast-children@1.0.5","_shasum":"d4b4400af9a128d3844b4841c9b6fe15e8ea6cce","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"jkroso","email":"jkroso@gmail.com"},"maintainers":[{"name":"jkroso","email":"jkroso@gmail.com"}],"dist":{"shasum":"d4b4400af9a128d3844b4841c9b6fe15e8ea6cce","tarball":"http://registry-npm.ywwl.com/ast-children/download/ast-children-1.0.5.tgz","integrity":"sha512-MCuIvK7D7wZ9KVkYpOmxmabEA6SO04N0dnIYOtI0SICqoEmA1q6HunYTX+T5u5UzSf28kQB4HZp0BNEnW4jtkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICjPZUY0qYe+QNuy5cq4sX4GQn7170iDGzWAqiGespzVAiEA5GVe9n1ym4D+UB5Nkzj1rtXedS+lb2GBUYg1lsOKdcg="}],"size":2042,"noattachment":false,"key":"/ast-children/-/ast-children-1.0.5.tgz"},"directories":{},"readme":"# ast-children\n\nget the children of an AST node\n\n## Installation\n\n`npm install ast-children`\n\nthen in your app:\n\n```js\nconst children = require('ast-children')\n```\n\n## API\n\n### children(node)\n\nTakes a [standard](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API) AST node and returns an `Array` of its child nodes\n\n```js\nvar ast = {\n  type: 'Program',\n  body: [\n    {\n      type: 'VariableDeclaration',\n      declarations: [\n        {\n          type: 'VariableDeclarator',\n          id: {type: 'Identifier', name: 'a'},\n          init: {type: 'Literal', value: 1}\n        },\n        {\n          type: 'VariableDeclarator',\n          id: {type: 'Identifier', name: 'b'}\n        }\n      ]\n    }\n  ]\n}\nchildren(ast) // => ast.body\nchildren(ast.body[0]) // => ast.body[0].declarations\nvar decs = ast.body[0].declarations\nchildren(decs[0]) // => [decs[0].id, decs[0].init]\nchildren(decs[1]) // => [decs[1].id]\n```\n","publish_time":1444625703169,"_cnpm_publish_time":1444625703169,"dist-tags":{"latest":"1.0.5"}}