{"_id":"call-limit","_rev":"141492","name":"call-limit","description":"Limit the number of simultaneous calls to an async function","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"iarna","email":""},{"name":"npm:iarna","email":""}],"time":{"modified":"2021-06-03T11:27:14.000Z","created":"2015-07-20T07:19:40.394Z","1.1.1":"2019-06-03T03:21:35.208Z","1.1.0":"2017-03-07T01:14:57.803Z","1.0.3":"2015-09-18T17:11:03.817Z","1.0.2":"2015-09-17T23:53:28.929Z","1.0.1":"2015-07-21T18:41:58.858Z","1.0.0":"2015-07-20T07:19:40.394Z"},"users":{"iarna":true},"author":{"name":"Rebecca Turner","email":"me@re-becca.org"},"repository":{"type":"git","url":"git+https://github.com/iarna/call-limit.git"},"versions":{"1.1.1":{"name":"call-limit","version":"1.1.1","description":"Limit the number of simultaneous calls to an async function","main":"call-limit.js","scripts":{"test":"tap test/*.js","prerelease":"npm t","release":"standard-version -s","postrelease":"npm publish && git push --follow-tags","pretest":"iarna-standard","update-coc":"weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'","update-contrib":"weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"},"repository":{"type":"git","url":"git+https://github.com/iarna/call-limit.git"},"author":{"name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","bugs":{"url":"https://github.com/iarna/call-limit/issues"},"homepage":"https://npmjs.com/packages/call-limit","dependencies":{},"devDependencies":{"tap":"^14.2.0","weallbehave":"*","weallcontribute":"*","@iarna/standard":"*","standard-version":"*"},"gitHead":"17de3ec82fdf84a6db6ff52f45f00cd7f5c67f8d","_id":"call-limit@1.1.1","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"ef15f2670db3f1992557e2d965abc459e6e358d4","size":2632,"noattachment":false,"key":"/call-limit/-/call-limit-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/call-limit/download/call-limit-1.1.1.tgz"},"maintainers":[{"name":"iarna","email":""},{"name":"npm:iarna","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/call-limit_1.1.1_1559532095089_0.14005293387908035"},"_hasShrinkwrap":false,"publish_time":1559532095208,"_cnpm_publish_time":1559532095208},"1.1.0":{"name":"call-limit","version":"1.1.0","description":"Limit the number of simultaneous calls to an async function","main":"call-limit.js","scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git+https://github.com/iarna/call-limit.git"},"author":{"name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","bugs":{"url":"https://github.com/iarna/call-limit/issues"},"homepage":"https://npmjs.com/packages/call-limit","dependencies":{},"devDependencies":{"tap":"^1.0.0"},"files":["call-limit.js"],"gitHead":"2b05fe72f0cf33a2aac951cd68dd949fccb0d9e9","_id":"call-limit@1.1.0","_shasum":"6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea","_from":".","_npmVersion":"4.4.1","_nodeVersion":"7.7.1","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea","size":1619,"noattachment":false,"key":"/call-limit/-/call-limit-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/call-limit/download/call-limit-1.1.0.tgz"},"maintainers":[{"name":"iarna","email":""},{"name":"npm:iarna","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/call-limit-1.1.0.tgz_1488849297527_0.29955350141972303"},"directories":{},"publish_time":1488849297803,"_cnpm_publish_time":1488849297803,"_hasShrinkwrap":false},"1.0.3":{"name":"call-limit","version":"1.0.3","description":"Limit the number of simultaneous calls to an async function","main":"index.js","scripts":{"prepublish":"babel call-limit.js --out-dir es5","test":"tap test/*.js"},"repository":{"type":"git","url":"git+https://github.com/iarna/call-limit.git"},"author":{"name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","bugs":{"url":"https://github.com/iarna/call-limit/issues"},"homepage":"https://npmjs.com/packages/call-limit","dependencies":{},"devDependencies":{"babel":"^5.0.2","tap":"^1.0.0"},"engine":{"node":">=0.10.x"},"gitHead":"15149704fdefd35bb66eb99188f32db0476078a9","_id":"call-limit@1.0.3","_shasum":"e0bd97382e4d13cc30a1863a1e0faa347226e1aa","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"e0bd97382e4d13cc30a1863a1e0faa347226e1aa","size":2142,"noattachment":false,"key":"/call-limit/-/call-limit-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/call-limit/download/call-limit-1.0.3.tgz"},"maintainers":[{"name":"iarna","email":""},{"name":"npm:iarna","email":""}],"directories":{},"publish_time":1442596263817,"_cnpm_publish_time":1442596263817,"_hasShrinkwrap":false},"1.0.2":{"name":"call-limit","version":"1.0.2","description":"Limit the number of simultaneous calls to an async function","main":"index.js","scripts":{"prepublish":"babel call-limit.js --out-dir es5","test":"tap test/*.js"},"repository":{"type":"git","url":"git+https://github.com/iarna/call-limit.git"},"author":{"name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","bugs":{"url":"https://github.com/iarna/call-limit/issues"},"homepage":"https://npmjs.com/packages/call-limit","dependencies":{},"devDependencies":{"babel":"^5.0.2","tap":"^1.0.0"},"engine":{"node":">=0.10.x"},"gitHead":"4c3baa002c691696004b1db2c7073efced30d8fb","_id":"call-limit@1.0.2","_shasum":"e79197c590540ff574d74d47aeb480cf6f61588b","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"e79197c590540ff574d74d47aeb480cf6f61588b","size":2143,"noattachment":false,"key":"/call-limit/-/call-limit-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/call-limit/download/call-limit-1.0.2.tgz"},"maintainers":[{"name":"iarna","email":""},{"name":"npm:iarna","email":""}],"directories":{},"publish_time":1442534008929,"_cnpm_publish_time":1442534008929,"_hasShrinkwrap":false},"1.0.1":{"name":"call-limit","version":"1.0.1","description":"Limit the number of simultaneous calls to an async function","main":"index.js","scripts":{"prepublish":"babel call-limit.js --out-dir es5","test":"tap test/*.js"},"repository":{"type":"git","url":"git+https://github.com/iarna/call-limit.git"},"author":{"name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","bugs":{"url":"https://github.com/iarna/call-limit/issues"},"homepage":"https://npmjs.com/packages/call-limit","dependencies":{},"devDependencies":{"babel":"^5.0.2","tap":"^1.0.0"},"engine":{"node":">=0.10.x"},"gitHead":"3d8953e6080d2d1f3a08989df9889afd46b57299","_id":"call-limit@1.0.1","_shasum":"3d4770098b4ea40be364e8c62c7b45b28e7bcc20","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.3","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"3d4770098b4ea40be364e8c62c7b45b28e7bcc20","size":2067,"noattachment":false,"key":"/call-limit/-/call-limit-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/call-limit/download/call-limit-1.0.1.tgz"},"maintainers":[{"name":"iarna","email":""},{"name":"npm:iarna","email":""}],"directories":{},"publish_time":1437504118858,"_cnpm_publish_time":1437504118858,"_hasShrinkwrap":false},"1.0.0":{"name":"call-limit","version":"1.0.0","description":"Limit the number of simultaneous calls to an async function","main":"index.js","scripts":{"prepublish":"babel call-limit.js --out-dir es5","test":"tap test/*.js"},"repository":{"type":"git","url":"git+https://github.com/iarna/call-limit.git"},"author":{"name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","bugs":{"url":"https://github.com/iarna/call-limit/issues"},"homepage":"https://npmjs.com/packages/call-limit","dependencies":{},"devDependencies":{"babel":"^5.0.2","tap":"^1.0.0"},"engine":{"node":">=0.10.x"},"gitHead":"827896d15813c9022bd0ead96000e0b2910f6020","_id":"call-limit@1.0.0","_shasum":"3cb4bbe7875b4f2267d8ec83ff51c762fdb4d292","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.3","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"3cb4bbe7875b4f2267d8ec83ff51c762fdb4d292","size":1907,"noattachment":false,"key":"/call-limit/-/call-limit-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/call-limit/download/call-limit-1.0.0.tgz"},"maintainers":[{"name":"iarna","email":""},{"name":"npm:iarna","email":""}],"directories":{},"publish_time":1437376780394,"_cnpm_publish_time":1437376780394,"_hasShrinkwrap":false}},"readme":"call-limit\n----------\n\nLimit the number of simultaneous executions of a async function.\n\n```javascript\nconst fs = require('fs')\nconst limit = require('call-limit')\nconst limitedStat = limit(fs.stat, 5)\n```\n\nOr with promise returning functions:\n\n```javascript\nconst fs = Bluebird.promisifyAll(require('fs'))\nconst limit = require('call-limit')\nconst limitedStat = limit.promise(fs.statAsync, 5)\n```\n\n### USAGE:\n\nGiven that:\n\n```javascript\nconst limit = require('call-limit')\n```\n\n### limit(func, maxRunning) → limitedFunc\n\nThe returned function will execute up to maxRunning calls of `func` at once. \nBeyond that they get queued and called when the previous call completes.\n\n`func` must accept a callback as the final argument and must call it when\nit completes, or `call-limit` won't know to dequeue the next thing to run.\n\nBy contrast, callers to `limitedFunc` do NOT have to pass in a callback, but\nif they do they'll be called when `func` calls its callback.\n\n### limit.promise(func, maxRunning) → limitedFunc\n\nThe returned function will execute up to maxRunning calls of `func` at once.\nBeyond that they get queued and called when the previous call completes.\n\n`func` must return a promise.\n\n`limitedFunc` will return a promise that resolves with the promise returned\nfrom the call to `func`.\n\n### limit.method(class, methodName, maxRunning)\n\nThis is sugar for:\n\n```javascript\nclass.prototype.methodName = limit(class.prototype.methodName, maxRunning)\n```\n\n### limit.method(object, methodName, maxRunning)\n\nThis is sugar for:\n\n```javascript\nobject.methodName = limit(object.methodName, maxRunning)\n```\n\nFor example `limit.promise.method(fs, 'stat', 5)` is the same as\n`fs.stat = limit.promise(fs.stat, 5)`.\n\n### limit.promise.method(class, methodName, maxRunning)\n\nThis is sugar for:\n\n```javascript\nclass.prototype.methodName = limit.promise(class.prototype.methodName, maxRunning)\n```\n\n### limit.promise.method(object, methodName, maxRunning)\n\nThis is sugar for:\n\n```javascript\nobject.methodName = limit.promise(object.methodName, maxRunning)\n```\n\nFor example `limit.promise.method(fs, 'statAsync', 5)` is the same as\n`fs.statAsync = limit.promise(fs.statAsync, 5)`.\n","_attachments":{},"homepage":"https://npmjs.com/packages/call-limit","bugs":{"url":"https://github.com/iarna/call-limit/issues"},"license":"ISC"}