{"_id":"looper","_rev":"346724","name":"looper","description":"async loops that never RangeError","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"time":{"modified":"2021-06-20T02:42:14.000Z","created":"2013-07-09T04:08:15.318Z","4.0.0":"2017-04-15T17:58:54.953Z","3.0.0":"2014-08-19T00:13:17.848Z","2.0.0":"2013-07-09T05:51:05.313Z","1.0.0":"2013-07-09T04:08:15.318Z"},"users":{},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://dominictarr.com"},"repository":{"type":"git","url":"git://github.com/dominictarr/looper.git"},"versions":{"4.0.0":{"name":"looper","description":"async loops that never RangeError","version":"4.0.0","homepage":"https://github.com/dominictarr/looper","repository":{"type":"git","url":"git://github.com/dominictarr/looper.git"},"dependencies":{},"devDependencies":{"tape":"1.0.4"},"scripts":{"test":"set -e; for t in test/*.js; do node $t; done"},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://dominictarr.com"},"license":"MIT","testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"gitHead":"8a2fda78168d0891e541c9e3618a087d48958c29","bugs":{"url":"https://github.com/dominictarr/looper/issues"},"_id":"looper@4.0.0","_shasum":"7706aded59a99edca06e6b54bb86c8ec19c95155","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"dist":{"shasum":"7706aded59a99edca06e6b54bb86c8ec19c95155","size":2360,"noattachment":false,"key":"/looper/-/looper-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/looper/download/looper-4.0.0.tgz"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/looper-4.0.0.tgz_1492279133263_0.5168007875327021"},"directories":{},"publish_time":1492279134953,"_hasShrinkwrap":false,"_cnpm_publish_time":1492279134953},"3.0.0":{"name":"looper","description":"async loops that never RangeError","version":"3.0.0","homepage":"https://github.com/dominictarr/looper","repository":{"type":"git","url":"git://github.com/dominictarr/looper.git"},"dependencies":{},"devDependencies":{"tape":"1.0.4"},"scripts":{"test":"set -e; for t in test/*.js; do node $t; done"},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://dominictarr.com"},"license":"MIT","testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/dominictarr/looper/issues"},"_id":"looper@3.0.0","_shasum":"2efa54c3b1cbaba9b94aee2e5914b0be57fbb749","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"dist":{"shasum":"2efa54c3b1cbaba9b94aee2e5914b0be57fbb749","size":2024,"noattachment":false,"key":"/looper/-/looper-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/looper/download/looper-3.0.0.tgz"},"directories":{},"publish_time":1408407197848,"_cnpm_publish_time":1408407197848,"_hasShrinkwrap":false},"2.0.0":{"name":"looper","description":"async loops that never RangeError","version":"2.0.0","homepage":"https://github.com/dominictarr/looper","repository":{"type":"git","url":"git://github.com/dominictarr/looper.git"},"dependencies":{},"devDependencies":{"tape":"1.0.4"},"scripts":{"test":"set -e; for t in test/*.js; do node $t; done"},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://dominictarr.com"},"license":"MIT","testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/dominictarr/looper/issues"},"_id":"looper@2.0.0","dist":{"shasum":"66cd0c774af3d4fedac53794f742db56da8f09ec","size":2104,"noattachment":false,"key":"/looper/-/looper-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/looper/download/looper-2.0.0.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{},"publish_time":1373349065313,"_cnpm_publish_time":1373349065313,"_hasShrinkwrap":false},"1.0.0":{"name":"looper","description":"async loops that never RangeError","version":"1.0.0","homepage":"https://github.com/dominictarr/looper","repository":{"type":"git","url":"git://github.com/dominictarr/looper.git"},"dependencies":{},"devDependencies":{"tape":"1.0.4"},"scripts":{"test":"set -e; for t in test/*.js; do node $t; done"},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://dominictarr.com"},"license":"MIT","testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/dominictarr/looper/issues"},"_id":"looper@1.0.0","dist":{"shasum":"9a7dcaa30a4bd759e53a1f084415c1c3c8cb45d9","size":1994,"noattachment":false,"key":"/looper/-/looper-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/looper/download/looper-1.0.0.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{},"publish_time":1373342895318,"_cnpm_publish_time":1373342895318,"_hasShrinkwrap":false}},"readme":"# looper\n\nLoop with callbacks but don't RangeError\n\n[![travis](https://travis-ci.org/dominictarr/looper.png?branch=master)\n](https://travis-ci.org/dominictarr/looper)\n\n[![testling](http://ci.testling.com/dominictarr/looper.png)\n](http://ci.testling.com/dominictarr/looper)\n\n## Synopsis\n\nNormally, if `mightBeAsync` calls it's cb immediately\nthis would `RangeError`:\n\n``` js\nvar l = 100000\n;(function next () {\n  if(--l) mightBeAsync(next)\n})\n```\n\n`looper` detects that case, and falls back to a `while` loop,\nin computer science something like this is called a [trampoline](https://en.wikipedia.org/wiki/Trampoline_(computing))\nthis module is simpler than other trampoline libraries such as [tail-call](https://github.com/Gozala/js-tail-call)\nbecause it does not preserve arguments. But this is still useful\nfor looping when  async recursion is sometimes sync.\n\nThis is about 10 times faster than using [setImmediate](http://devdocs.io/node~6_lts/timers#timers_setimmediate_callback_args)\n\n## Example\n\n``` js\nvar looper = require('looper')\n\nvar l = 100000\nvar next = looper(function () {\n  if(--l) probablySync(next)\n})\n\nnext()\n```\n\nwhen you want to stop looping, don't call `next`.\n`looper` checks if each callback is sync or not,\nso you can even mix sync and async calls!\n\n## License\n\nMIT\n\n","_attachments":{},"homepage":"https://github.com/dominictarr/looper","bugs":{"url":"https://github.com/dominictarr/looper/issues"},"license":"MIT"}