{"_id":"gnode","_rev":"370745","name":"gnode","description":"Run node with ES6 Generators, today!","dist-tags":{"latest":"0.1.2"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2021-07-27T02:34:38.000Z","created":"2013-10-31T02:30:49.342Z","0.1.2":"2016-02-09T06:26:40.239Z","0.1.1":"2015-01-14T18:52:44.816Z","0.1.0":"2014-09-12T17:38:39.892Z","0.0.8":"2014-04-29T05:19:20.358Z","0.0.7":"2014-02-15T02:31:35.333Z","0.0.6":"2014-01-06T18:18:58.575Z","0.0.5":"2013-12-19T23:14:02.133Z","0.0.4":"2013-11-11T19:56:34.532Z","0.0.3":"2013-10-31T17:32:54.634Z","0.0.2":"2013-10-31T06:00:07.570Z","0.0.1":"2013-10-31T02:30:49.342Z"},"users":{"thotjs":true,"inikulin":true,"grncdr":true,"magnus":true,"goliatone":true},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"versions":{"0.1.2":{"name":"gnode","version":"0.1.2","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.8.8"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"gitHead":"978e1a4af211382592c8a32c16ff3674287da5a7","homepage":"https://github.com/TooTallNate/gnode","_id":"gnode@0.1.2","_shasum":"0a955a5cc222f699e14306a4559505d90080fdd9","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"0a955a5cc222f699e14306a4559505d90080fdd9","size":8482,"noattachment":false,"key":"/gnode/-/gnode-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.1.2.tgz"},"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/gnode-0.1.2.tgz_1454999199080_0.789880472002551"},"directories":{},"publish_time":1454999200239,"_cnpm_publish_time":1454999200239,"_hasShrinkwrap":false},"0.1.1":{"name":"gnode","version":"0.1.1","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.8.8"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"gitHead":"12b4fb12e0cb41bf8b5602b288254526ea5874b3","homepage":"https://github.com/TooTallNate/gnode","_id":"gnode@0.1.1","_shasum":"82e1e12bc6007938520211e3987166ac30420aa6","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"82e1e12bc6007938520211e3987166ac30420aa6","size":8197,"noattachment":false,"key":"/gnode/-/gnode-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.1.1.tgz"},"directories":{},"publish_time":1421261564816,"_cnpm_publish_time":1421261564816,"_hasShrinkwrap":false},"0.1.0":{"name":"gnode","version":"0.1.0","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.6.3"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"gitHead":"a896f11d5588ff14f2589372c01130a9d9e638f0","homepage":"https://github.com/TooTallNate/gnode","_id":"gnode@0.1.0","_shasum":"190fb443ead267edf77347cde02008541246fcc9","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"190fb443ead267edf77347cde02008541246fcc9","size":8224,"noattachment":false,"key":"/gnode/-/gnode-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.1.0.tgz"},"directories":{},"publish_time":1410543519892,"_cnpm_publish_time":1410543519892,"_hasShrinkwrap":false},"0.0.8":{"name":"gnode","version":"0.0.8","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"0"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"homepage":"https://github.com/TooTallNate/gnode","_id":"gnode@0.0.8","dist":{"shasum":"0432689ce764acfef1dbe23c3816a96f3b77bfd4","size":8212,"noattachment":false,"key":"/gnode/-/gnode-0.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.8.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1398748760358,"_cnpm_publish_time":1398748760358,"_hasShrinkwrap":false},"0.0.7":{"name":"gnode","version":"0.0.7","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"0"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"homepage":"https://github.com/TooTallNate/gnode","_id":"gnode@0.0.7","dist":{"shasum":"24610782c6360da6bfd32a8b7d12ab3db13061ce","size":7785,"noattachment":false,"key":"/gnode/-/gnode-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.7.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1392431495333,"_cnpm_publish_time":1392431495333,"_hasShrinkwrap":false},"0.0.6":{"name":"gnode","version":"0.0.6","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.3.4"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"readmeFilename":"README.md","homepage":"https://github.com/TooTallNate/gnode","_id":"gnode@0.0.6","dist":{"shasum":"c6a05e79d54987244b839c501e312d4bfa5d29d9","size":7753,"noattachment":false,"key":"/gnode/-/gnode-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.6.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1389032338575,"_cnpm_publish_time":1389032338575,"_hasShrinkwrap":false},"0.0.5":{"name":"gnode","version":"0.0.5","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.3.2"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"readmeFilename":"README.md","homepage":"https://github.com/TooTallNate/gnode","_id":"gnode@0.0.5","dist":{"shasum":"8bf4b4a1f61dc0d3dcbdb4834016bc8c9cb447f8","size":7606,"noattachment":false,"key":"/gnode/-/gnode-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.5.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1387494842133,"_cnpm_publish_time":1387494842133,"_hasShrinkwrap":false},"0.0.4":{"name":"gnode","version":"0.0.4","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.2.5"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","semver":"~2.2.1","suspend":"~0.3.0"},"readmeFilename":"README.md","_id":"gnode@0.0.4","dist":{"shasum":"bd943a7d466a1fd48625aaaec0966ca19ab72834","size":6898,"noattachment":false,"key":"/gnode/-/gnode-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.4.tgz"},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1384199794532,"_cnpm_publish_time":1384199794532,"_hasShrinkwrap":false},"0.0.3":{"name":"gnode","version":"0.0.3","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.2.5"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","suspend":"~0.3.0"},"readmeFilename":"README.md","_id":"gnode@0.0.3","dist":{"shasum":"5de559ff4eb2904caa94142cb961d429c13b8c4e","size":5125,"noattachment":false,"key":"/gnode/-/gnode-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.3.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1383240774634,"_cnpm_publish_time":1383240774634,"_hasShrinkwrap":false},"0.0.2":{"name":"gnode","version":"0.0.2","description":"Run node with ES6 Generators, today!","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.2.5"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","suspend":"~0.3.0"},"readmeFilename":"README.md","_id":"gnode@0.0.2","dist":{"shasum":"268fa3ea8de18717b0f9903cb1a5bb4a286a3111","size":4936,"noattachment":false,"key":"/gnode/-/gnode-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1383199207570,"_cnpm_publish_time":1383199207570,"_hasShrinkwrap":false},"0.0.1":{"name":"gnode","version":"0.0.1","description":"Run node with ES6 Generators","main":"index.js","bin":{"gnode":"bin/gnode"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/TooTallNate/gnode.git"},"keywords":["node","generators","es6","facebook","regenerator","co"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"dependencies":{"regenerator":"~0.2.5"},"devDependencies":{"co":"~2.1.0","mocha":"~1.13.0","suspend":"~0.3.0"},"readmeFilename":"README.md","_id":"gnode@0.0.1","dist":{"shasum":"97d50b4babc6c0641dc84dfadd57034b377ab9a3","size":3073,"noattachment":false,"key":"/gnode/-/gnode-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/gnode/download/gnode-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1383186649342,"_cnpm_publish_time":1383186649342,"_hasShrinkwrap":false}},"readme":"gnode\n=====\n### Run node with ES6 Generators, today!\n[![Build Status](https://travis-ci.org/TooTallNate/gnode.svg?branch=master)](https://travis-ci.org/TooTallNate/gnode)\n\n`gnode` is a very light wrapper around your `node` executable that ensures\n[ES6 Generator][generators] support, even on versions of node that do not\nsupport ES6 Generators natively.\n\nYou use it exactly like the regular `node` executable, except that you _do not_\nneed to pass the `--harmony-generators` flag. That is where the magic happens.\n\nWith `gnode` you can use [`co`][co] or [`suspend`][suspend], or any other\nGenerator-based flow control based module, today!\n\n\nHow does this magic work?\n-------------------------\n\n#### node &lt; 0.11.3\n\nWhen V8 provides no native ES6 generators support, then `gnode` invokes a node\ninstance with a patched `require.extensions['.js']` function, which transparently\ntranspiles your ES6 code with Generators into ES5-compatible code. We can thank\n[`facebook/regenerator`][regenerator] for making this possible.\n\nUnder the hood, this command:\n\n``` bash\n$ gnode foo.js all the args\n```\n\nTurns into something like this:\n\n``` bash\n$ GNODE_ENTRY_POINT=foo.js node fallback.js all the args\n```\n\n#### node &gt;= 0.11.3\n\nWhen V8 supports ES6 generators natively, then `gnode` invokes a node instance\nwith the `--harmony-generators` flag passed in transparently, so that the native\ngenerators are used, and no transpiling takes place. Everything else _just works_\nas you would expect it to.\n\nUnder the hood, this command:\n\n``` bash\n$ gnode foo.js all the args\n```\n\nTurns into something like this:\n\n``` bash\n$ node --harmony-generators foo.js all the args\n```\n\n\nInstallation\n------------\n\nInstall the `gnode` executable via npm:\n\n``` bash\n$ npm install -g gnode\n```\n\n\nCLI Examples\n------------\n\nThe `gnode` executable uses whatever version of node is installed in your `PATH`:\n\nHere's our example `t.js` file:\n\n``` js\nvar co = require('co');\n\nfunction sleep (ms) {\n  return function (fn) {\n    setTimeout(fn, ms);\n  };\n}\n\nco(function* () {\n  for (var i = 0; i < 5; i++) {\n    console.log(i);\n    yield sleep(1000);\n  }\n})();\n```\n\nThis script with an ES6 Generator in it can be run using any version of node\nby using `gnode`:\n\n``` bash\n☮ ~ (master) ∴ n 0.8.26\n\n☮ ~ (master) ∴ gnode -v\nv0.8.26\n\n☮ ~ (master) ∴ gnode t.js\n0\n1\n2\n3\n4\n\n☮ ~ (master) ∴ n 0.10.21\n\n☮ ~ (master) ∴ gnode -v\nv0.10.21\n\n☮ ~ (master) ∴ gnode t.js\n0\n1\n2\n3\n4\n\n☮ ~ (master) ∴ n 0.11.8\n\n☮ ~ (master) ∴ gnode -v\nv0.11.8\n\n☮ ~ (master) ∴ gnode t.js\n0\n1\n2\n3\n4\n```\n\n\nProgrammatic API\n----------------\n\nYou can also just `require('gnode')` in a script _without any generators_, and\nthen `require()` any other .js file that has generators after that.\n\n``` js\nrequire('gnode');\nvar gen = require('./someGenerator');\n// etc…\n```\n\n[co]: https://github.com/visionmedia/co\n[suspend]: https://github.com/jmar777/suspend\n[generators]: http://wiki.ecmascript.org/doku.php?id=harmony:generators\n[regenerator]: https://github.com/facebook/regenerator\n","_attachments":{},"homepage":"https://github.com/TooTallNate/gnode","bugs":{"url":"https://github.com/TooTallNate/gnode/issues"},"license":"MIT"}