{"versions":{"1.0.2":{"name":"fast-future","version":"1.0.2","description":"A really fast way to run a callback in the future","main":"fast-future.js","scripts":{"test":"node test.js"},"author":{"name":"David Björklund","email":"david.bjorklund@gmail.com"},"license":"MIT","devDependencies":{"tape":"~2.13.1"},"repository":{"type":"git","url":"git://github.com/kesla/fast-future.git"},"bugs":{"url":"https://github.com/kesla/fast-future/issues"},"homepage":"https://github.com/kesla/fast-future","gitHead":"0a08e26e4c822a342b200b0fd9c2608cff3fefa7","_id":"fast-future@1.0.2","_shasum":"8435a9aaa02d79248d17d704e76259301d99280a","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"anonymous","email":"david.bjorklund@gmail.com"},"dist":{"shasum":"8435a9aaa02d79248d17d704e76259301d99280a","size":2530,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fast-future/-/fast-future-1.0.2.tgz","integrity":"sha512-ZdgcQC4CDq0OlirlbmaV1Hvl9hrQBKwSJokpemb2Y82uzQ3mFaGxBCCTbr78t3obRsgjqrJAsEaYWZSK3oEcJQ=="},"maintainers":[{"name":"anonymous","email":"david.bjorklund@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/fast-future-1.0.2.tgz_1481917162442_0.7028130751568824"},"directories":{},"publish_time":1481917163078,"_hasShrinkwrap":false,"_cnpm_publish_time":1481917163078,"_cnpmcore_publish_time":"2021-12-16T11:20:57.836Z","contributors":[]},"1.0.1":{"name":"fast-future","version":"1.0.1","description":"A really fast way to run a callback in the future","main":"fast-future.js","scripts":{"test":"tape test.js"},"author":{"name":"David Björklund","email":"david.bjorklund@gmail.com"},"license":"MIT","devDependencies":{"tape":"~2.13.1"},"repository":{"type":"git","url":"git://github.com/kesla/fast-future.git"},"bugs":{"url":"https://github.com/kesla/fast-future/issues"},"homepage":"https://github.com/kesla/fast-future","_id":"fast-future@1.0.1","dist":{"shasum":"6cbd22d999ab39cd10fc79392486e7a678716818","size":2550,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fast-future/-/fast-future-1.0.1.tgz","integrity":"sha512-rtNCEaGgAcCz9xXV64ELkSd49nQ48opD8R30N5XJd40/TeJaIDd1Z8TQ6iGg05j16ITQOO3/3U5PAX9G0bLSUw=="},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"anonymous","email":"david.bjorklund@gmail.com"},"maintainers":[{"name":"anonymous","email":"david.bjorklund@gmail.com"}],"directories":{},"publish_time":1400530241527,"_hasShrinkwrap":false,"_cnpm_publish_time":1400530241527,"_cnpmcore_publish_time":"2021-12-16T11:20:58.053Z","contributors":[]},"1.0.0":{"name":"fast-future","version":"1.0.0","description":"A really fast way to run a callback in the future","main":"fast-future.js","scripts":{"test":"node benchmark.js 10000"},"author":{"name":"David Björklund","email":"david.bjorklund@gmail.com"},"license":"MIT","devDependencies":{"tape":"~2.13.1"},"repository":{"type":"git","url":"git://github.com/kesla/fast-future.git"},"bugs":{"url":"https://github.com/kesla/fast-future/issues"},"homepage":"https://github.com/kesla/fast-future","_id":"fast-future@1.0.0","dist":{"shasum":"f7f9493a62d30c45d49c86670bf1b7a3748e2096","size":2410,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fast-future/-/fast-future-1.0.0.tgz","integrity":"sha512-ZDfVTgOmtBEVt8C0ErXwVa7i0Q7ykoAi3E2kbRescXVv0ru5adTGaDKwPOOcHN2pcLSsqghCwtLG/uqJBYEXxA=="},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"anonymous","email":"david.bjorklund@gmail.com"},"maintainers":[{"name":"anonymous","email":"david.bjorklund@gmail.com"}],"directories":{},"publish_time":1400450306270,"_hasShrinkwrap":false,"_cnpm_publish_time":1400450306270,"_cnpmcore_publish_time":"2021-12-16T11:20:58.279Z","contributors":[]}},"dist-tags":{"latest":"1.0.2"},"name":"fast-future","time":{"created":"2022-01-26T19:30:55.194Z","modified":"2022-01-26T19:30:55.194Z","1.0.2":"2016-12-16T19:39:23.078Z","1.0.1":"2014-05-19T20:10:41.527Z","1.0.0":"2014-05-18T21:58:26.270Z"},"readme":"# fast-future[![build status](https://secure.travis-ci.org/kesla/fast-future.png)](http://travis-ci.org/kesla/fast-future)\n\nA really fast way to run a callback in the future\n\n[![NPM](https://nodei.co/npm/fast-future.png?downloads&stars)](https://nodei.co/npm/fast-future/)\n\n[![NPM](https://nodei.co/npm-dl/fast-future.png)](https://nodei.co/npm/fast-future/)\n\n## Installation\n\n```\nnpm install fast-future\n```\n\n## What? How does is work?\n\nSince node.js v0.10.x the semantics of `process.nextTick` changed (see [docs](http://nodejs.org/docs/v0.10.12/api/process.html#process_process_nexttick_callback)). To get the old behaviour one can use setImmediate instead.\n\nThe good part about `process.nextTick` is that it's really really fast. The bad part is that event loop can be starved and if run for to long time it'll eventually die with a `RangeError: Maximum call stack size exceeded`.\n\nWhat's good about `setImmediate` is that it won't starve the event loop. However, it's a bit slower than `process.nextTick`.\n\n_fast-future_ uses the best from the both worlds - the callback will most of the times be called in a process.nextTick, but once in a while it'll get run in a `setImmediate` - so you'll get crazy performance, and the event loop won't get starved or crash or something sad like that.\n\nFor me running the benchmarks show the following result\n\n```\n# setImmediate\nsetImmediate: 2317ms\n# fastFuture\nfastFuture: 96ms\n```\n\nFor node v0.8.x it'll fallback to using process.nextTick\n\n## Example\n\n```javascript\nvar fastFuture = require('./fast-future')()\n\nfastFuture(function () {\n  console.log('this is being run in the future')\n})\n```\n\n## Kudos\n\nThanks @mafintosh for suggesting this!\n\n## Licence\nCopyright (c) 2014 David Björklund\n\nThis software is released under the MIT license:\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.","users":{}}