{"_id":"hoister","_rev":"46188","name":"hoister","description":"Put all function and variable declarations at the top of the scope in an AST","dist-tags":{"latest":"0.0.2"},"maintainers":[{"name":"mmckegg","email":"matt@wetsand.co.nz"},{"name":"realisation","email":"james.foley@protonmail.com"}],"time":{"modified":"2021-06-03T10:14:12.000Z","created":"2013-11-25T23:23:18.174Z","0.0.2":"2013-11-26T06:42:41.343Z","0.0.1":"2013-11-25T23:23:18.174Z"},"users":{},"author":{"name":"Matt McKegg"},"repository":{"type":"git","url":"https://github.com/mmckegg/hoister.git"},"versions":{"0.0.2":{"name":"hoister","version":"0.0.2","description":"Put all function and variable declarations at the top of the scope in an AST","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"https://github.com/mmckegg/hoister.git"},"keywords":["ast","hoist","esprima","javascript"],"author":{"name":"Matt McKegg"},"license":"MIT","readmeFilename":"README.md","gitHead":"d21084a8a5a5382128b88dd3c5ba960bee261d96","bugs":{"url":"https://github.com/mmckegg/hoister/issues"},"devDependencies":{"esprima":"~1.0","tape":"~2.3"},"_id":"hoister@0.0.2","dist":{"shasum":"0d0d8b1ce0f191553e61afec654f6b180eb96e5d","size":1664,"noattachment":false,"key":"/hoister/-/hoister-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hoister/download/hoister-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.25","_npmUser":{"name":"mmckegg","email":"matt@wetsand.co.nz"},"maintainers":[{"name":"mmckegg","email":"matt@wetsand.co.nz"},{"name":"realisation","email":"james.foley@protonmail.com"}],"publish_time":1385448161343,"_cnpm_publish_time":1385448161343,"_hasShrinkwrap":false},"0.0.1":{"name":"hoister","version":"0.0.1","description":"Put all function and variable declarations at the top of the scope in an AST","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"https://github.com/mmckegg/hoister.git"},"keywords":["ast","hoist","esprima","javascript"],"author":{"name":"Matt McKegg"},"license":"MIT","readmeFilename":"README.md","gitHead":"d21084a8a5a5382128b88dd3c5ba960bee261d96","bugs":{"url":"https://github.com/mmckegg/hoister/issues"},"devDependencies":{"esprima":"~1.0","tape":"~2.3"},"_id":"hoister@0.0.1","dist":{"shasum":"658df7cd31d8ba22e5ec743e2f29903fb454acff","size":1661,"noattachment":false,"key":"/hoister/-/hoister-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hoister/download/hoister-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.25","_npmUser":{"name":"mmckegg","email":"matt@wetsand.co.nz"},"maintainers":[{"name":"mmckegg","email":"matt@wetsand.co.nz"},{"name":"realisation","email":"james.foley@protonmail.com"}],"publish_time":1385421798174,"_cnpm_publish_time":1385421798174,"_hasShrinkwrap":false}},"readme":"hoister\n=======\n\nPut all function and variable declarations at the top of the scope in an AST \n\n[![NPM](https://nodei.co/npm/hoister.png?compact=true)](https://nodei.co/npm/hoister/)\n\n## Example\n\n```js\nvar parse = require('esprima').parse\nvar generate = require('escodegen').generate\nvar hoist = require('hoist')\n\nvar src = 'a = func(123); var a = \"test\"; function func(x){return x}'\nvar ast = parse(src)\nhoist(ast)\n\nconsole.log(generate(ast))\n```\n\nConsole result:\n\n```js\nfunction func(x) {\n  return x;\n}\nvar a;\na = func(123);\nvar a = 'test';\n```","_attachments":{},"readmeFilename":"README.md","bugs":{"url":"https://github.com/mmckegg/hoister/issues"},"license":"MIT"}