{"name":"babybird","version":"0.0.1","description":"Very fast standards-compliant ES2015 promises.","main":"lib/promise.js","scripts":{"jscs":"jscs .","jscs-fix":"jscs --fix .","lint":"jshint . && npm run jscs","lint-no-0.8":"node -e 'process.exit(/v0[.][0-8][.]/.test(process.version) ? 0 : 1)' || npm run lint","mocha":"mocha","test":"npm run lint-no-0.8 && npm run mocha","bench":"./bench doxbee node 20000"},"repository":{"type":"git","url":"git+https://github.com/cscott/babybird.git"},"keywords":["promise"],"author":{"name":"C. Scott Ananian"},"license":"MIT","bugs":{"url":"https://github.com/cscott/babybird/issues"},"homepage":"https://github.com/cscott/babybird#readme","dependencies":{"asap":"^2.0.3","is-arguments":"^1.0.2"},"devDependencies":{"glob":"^6.0.1","jscs":"~2.7.0","jshint":"^2.9.1-rc1","mocha":"^2.3.4","promises-aplus-tests":"^2.1.1","test262":"git://github.com/cscott/test262.git#master","test262-parser":"git://github.com/cscott/test262-parser.git#gh-11"},"readme":"# babybird\n[![NPM][NPM1]][NPM2]\n\n[![Build Status][1]][2] [![dependency status][3]][4] [![dev dependency status][5]][6]\n\nA very fast standards-compliant [ES2015] Promise library for node.\n\nThere are several fast promise implementations out there, like\n[`bluebird`], but they all add a bunch of stuff that's not in the\n[ES2015] Promise spec.  Further, as they've added more and more\nfeatures they've grown so complex that they can't be easily audited\nagainst the ES2015 spec (or the official `test262` test suite).\n\nThe `babybird` library is a stripped-down \"just ES2015\" Promise\nimplementation, which passes the Promises/A+ and `test262` test\nsuites.  It is very competitive with the performance of [`bluebird`],\nwithout having to give us standards compliance.  On the doxbee\nbenchmark running under node 5.1.0, `babybird` is 2.4 times faster\nthan native Promises, 4 times faster than the Promise implementation\nin [`core-js`], and almost 9 times faster than the Promise\nimplementation in [`es6-shim`].  The performance improvement is even\ngreater when running under node 0.10.\n\nFurther, `babybird` supports subclassing (as all ES2015 Promise\nimplementations ought).  This means that if you'd like additional\nbells and whistles on your Promises, you can add then via subclassing\nand without stomping on the global Promise.  In fact, the [`prfun`]\nlibrary provides much the same feature set as `bluebird`, but with a\nclean separation of concerns.  Further, `prfun` runs on top of *any*\nES2015-compliant Promise implementation, so if `babybird` is someday\nsupplanted, you can just swap out the core Promise implementation\nunderneath `prfun` without having to update any of your uses of the\ncore ES2015 or extended `prfun` API.\n\n## Usage\n```\nnpm install babybird\n```\n\n```javascript\nvar Promise = require('babybird');\n```\n\nThe `babybird` library plays very nicely with [`prfun`], if you'd like\na few bells and whistles with your library.  I recommend creating a\nnew module, named (say) `promise.js`, with the contents:\n```javascript\nmodule.exports = require('prfun/wrap')(require('babybird'));\n```\nand then using the wrapped promises this way:\n```javascript\nvar Promise = require('./promise.js');\n```\n\n## Benchmarks\nThese benchmarks are derived from the benchmarks included with\n`bluebird`.  A few of the bluebird test cases have been forked to\nadd \"fair\" versions, since bluebird obtained some of its speed by\nusing a faster `promisify` method than that provided to other\npromise implementations, and by using a few `bluebird`-specific\nAPIs which appeared to be tuned for the benchmark.\n\nYou can reproduce these results using `npm run bench`.\n\n### Node 0.10\n```\nresults for 20000 parallel executions, 1 ms per I/O op\n\nfile                                         time(ms)  slowdown  memory(MB)\ncallbacks-baseline.js                             819      0.48  32.99\npromises-bluebird.js                             1383      0.81  50.59\npromises-bluebird-fair.js                        1715      1.00  39.02\npromises-cscott-babybird-noall.js                1870      1.09  41.19\npromises-cscott-babybird.js                      1925      1.12  61.81\npromises-cscott-babybird-prfun.js                1991      1.16  48.60\npromises-then-promise-es6.js                     3084      1.80  64.54\npromises-then-promise.js                         3112      1.81  64.39\npromises-paulmillr-es6shim.js                   12475      7.27  94.20\npromises-zloirock-corejs.js                     18695     10.90  94.11\n\nPlatform info:\nLinux 4.2.0-1-amd64 ia32\nNode.JS 0.10.40\nV8 3.14.5.9\nIntel(R) Core(TM) i7 CPU       L 640  @ 2.13GHz × 4\n```\n\n### Node 5.1.0\n```\nresults for 20000 parallel executions, 1 ms per I/O op\n\nfile                                         time(ms)  slowdown  memory(MB)\ncallbacks-baseline.js                             826      0.53  29.29\npromises-bluebird-generator.js                   1105      0.71  25.49\npromises-bluebird-generator-fair.js              1113      0.72  28.27\npromises-cscott-babybird-prfun-generator.js      1202      0.77  33.68\npromises-bluebird-fair.js                        1553      1.00  51.38\npromises-cscott-babybird-noall.js                1623      1.05  65.25\npromises-bluebird.js                             1643      1.06  43.66\npromises-cscott-babybird-prfun.js                1707      1.10  72.33\npromises-cscott-babybird.js                      1724      1.11  72.82\npromises-then-promise-es6.js                     2985      1.92  106.96\npromises-then-promise.js                         3004      1.93  106.69\npromises-ecmascript6-native.js                   3770      2.43  176.96\npromises-zloirock-corejs.js                      6298      4.06  155.89\npromises-paulmillr-es6shim.js                   13892      8.95  227.61\n\nPlatform info:\nLinux 4.2.0-1-amd64 ia32\nNode.JS 5.1.0\nV8 4.6.85.31\nIntel(R) Core(TM) i7 CPU       L 640  @ 2.13GHz × 4\n```\n\n## License\n\nCopyright (c) 2015 C. Scott Ananian\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n[ES2015]:     http://www.ecma-international.org/ecma-262/6.0/\n[`bluebird`]: https://github.com/petkaantonov/bluebird\n[`es6-shim`]: https://github.com/paulmillr/es6-shim\n[`core-js`]:  https://github.com/zloirock/core-js\n[`prfun`]:    https://github.com/cscott/prfun\n\n[NPM1]: https://nodei.co/npm/babybird.png\n[NPM2]: https://nodei.co/npm/babybird/\n\n[1]: https://travis-ci.org/cscott/babybird.png\n[2]: https://travis-ci.org/cscott/babybird\n[3]: https://david-dm.org/cscott/babybird.png\n[4]: https://david-dm.org/cscott/babybird\n[5]: https://david-dm.org/cscott/babybird/dev-status.png\n[6]: https://david-dm.org/cscott/babybird#info=devDependencies\n","readmeFilename":"README.md","_id":"babybird@0.0.1","_shasum":"da80c79c6d7441cdfec7c2ff2dcbd7c13ebdbea2","_from":"https://registry.npmjs.org/babybird/-/babybird-0.0.1.tgz","_resolved":"https://registry.npmjs.org/babybird/-/babybird-0.0.1.tgz"}