{"_id":"promise-call-limit","_rev":"60457","name":"promise-call-limit","description":"Call an array of promise-returning functions, restricting concurrency to a specified limit.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"isaacs","email":""}],"time":{"modified":"2022-10-18T09:49:04.000Z","created":"2020-01-28T01:15:33.935Z","1.0.1":"2020-01-28T01:19:57.798Z","1.0.0":"2020-01-28T01:15:33.935Z"},"users":{},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"repository":{"type":"git","url":"git+https://github.com/isaacs/promise-call-limit.git"},"versions":{"1.0.1":{"name":"promise-call-limit","version":"1.0.1","description":"Call an array of promise-returning functions, restricting concurrency to a specified limit.","repository":{"type":"git","url":"git+https://github.com/isaacs/promise-call-limit.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.10.6"},"funding":{"url":"https://github.com/sponsors/isaacs"},"gitHead":"e500ec357962249ce3b249d2f7c44b4a8be1da83","bugs":{"url":"https://github.com/isaacs/promise-call-limit/issues"},"homepage":"https://github.com/isaacs/promise-call-limit#readme","_id":"promise-call-limit@1.0.1","_nodeVersion":"13.4.0","_npmVersion":"6.13.6","dist":{"shasum":"4bdee03aeb85674385ca934da7114e9bcd3c6e24","size":1752,"noattachment":false,"key":"/promise-call-limit/-/promise-call-limit-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/promise-call-limit/download/promise-call-limit-1.0.1.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-call-limit_1.0.1_1580174397658_0.08131277134967263"},"_hasShrinkwrap":false,"publish_time":1580174397798,"_cnpm_publish_time":1580174397798},"1.0.0":{"name":"promise-call-limit","version":"1.0.0","description":"Call an array of promise-returning functions, restricting concurrency to a specified limit.","repository":{"type":"git","url":"git+https://github.com/isaacs/promise-call-limit.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.10.6"},"gitHead":"f261432f053a17a5b37a8bdbd0f0b6175347901b","bugs":{"url":"https://github.com/isaacs/promise-call-limit/issues"},"homepage":"https://github.com/isaacs/promise-call-limit#readme","_id":"promise-call-limit@1.0.0","_nodeVersion":"13.4.0","_npmVersion":"6.13.6","dist":{"shasum":"38a6300a6df722372f137d91af5f0857141f5a93","size":1730,"noattachment":false,"key":"/promise-call-limit/-/promise-call-limit-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/promise-call-limit/download/promise-call-limit-1.0.0.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-call-limit_1.0.0_1580174133846_0.18454780895004275"},"_hasShrinkwrap":false,"publish_time":1580174133935,"_cnpm_publish_time":1580174133935}},"readme":"# promise-call-limit\n\nCall an array of promise-returning functions, restricting concurrency to a\nspecified limit.\n\n## USAGE\n\n```js\nconst promiseCallLimit = require('promise-call-limit')\nconst things = getLongListOfThingsToFrobulate()\n\n// frobulate no more than 4 things in parallel\npromiseCallLimit(things.map(thing => () => frobulateThing(thing)), 4)\n  .then(results => console.log('frobulated 4 at a time', results))\n```\n\n## API\n\n### promiseCallLimit(queue Array<() => Promise>, limit = defaultLimit)\n\nThe default limit is the number of CPUs on the system - 1, or 1.\n\nThe reason for subtracting one is that presumably the main thread is taking\nup a CPU as well, so let's not be greedy.\n\nNote that the array should be a list of Promise-_returning_ functions, not\nPromises themselves.  If you have a bunch of Promises already, you're best\noff just calling `Promise.all()`.\n\nThe functions in the queue are called without any arguments.\n","_attachments":{},"homepage":"https://github.com/isaacs/promise-call-limit#readme","bugs":{"url":"https://github.com/isaacs/promise-call-limit/issues"},"license":"ISC"}