{"name":"ast-children","version":"0.1.0","description":"get the children of an AST node","keywords":["ast","children"],"dependencies":{},"devDependencies":{"assert":"git://github.com/component/assert","serve":"git://github.com/jkroso/serve","match":"git://github.com/jkroso/match","hydro-bdd":"*","hydro-html":"*","hydro-dot":"*","esprima":"*","hydro":"*","jsmd":"*"},"repository":{"type":"git","url":"git://github.com/jkroso/ast-children.git"},"bugs":{"url":"https://github.com/jkroso/ast-children/issues"},"author":{"name":"Jake Rosoman"},"files":["index.js"],"license":"MIT","homepage":"https://github.com/jkroso/ast-children","_id":"ast-children@0.1.0","_shasum":"7d7410b174c1911732f4357b2112e68873559e03","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"jkroso","email":"jkroso@gmail.com"},"maintainers":[{"name":"jkroso","email":"jkroso@gmail.com"}],"dist":{"shasum":"7d7410b174c1911732f4357b2112e68873559e03","tarball":"http://registry-npm.ywwl.com/ast-children/download/ast-children-0.1.0.tgz","integrity":"sha512-5JEavq7cDEEsw50+8Tpp//q1rIKSA2zWFVGIUFv2zsXcqm0j6AIL5x1PgTp9DXEhHEk63b9L1CpJibAP8DbyPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjXYZRbnezp+UIRsdIi9beZo69Y+hCOWsCGdd+r97p1AiEA/mB5H+VYAEj3FRuIQkExierMVgv1VJ8l97sG44pCklY="}],"size":1496,"noattachment":false,"key":"/ast-children/-/ast-children-0.1.0.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":1400285167467,"_cnpm_publish_time":1400285167467,"dist-tags":{"latest":"1.0.5"}}