{"_id":"async-sema","_rev":"2874561","name":"async-sema","description":"Semaphore using `async` and `await`","dist-tags":{"latest":"3.1.1"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"time":{"modified":"2022-10-06T06:56:16.000Z","created":"2017-07-28T21:33:36.430Z","3.1.1":"2021-08-17T14:08:12.703Z","3.1.0":"2019-12-20T21:12:13.749Z","3.0.1":"2019-08-23T16:36:34.288Z","3.0.0":"2019-02-25T05:26:13.186Z","2.2.0":"2019-02-22T16:45:56.688Z","2.1.4":"2018-10-05T18:36:42.969Z","2.1.3":"2018-09-24T06:19:00.714Z","2.1.2":"2018-07-20T21:26:24.289Z","2.1.1":"2018-06-13T14:19:57.398Z","2.1.0":"2018-05-17T14:53:24.059Z","2.0.0":"2018-03-18T21:23:02.737Z","1.4.1":"2018-01-21T21:25:31.215Z","1.4.0":"2018-01-20T09:10:00.108Z","1.3.0":"2018-01-19T16:21:23.602Z","1.2.0":"2017-09-29T08:43:58.262Z","1.1.0":"2017-08-10T08:02:24.523Z","1.0.2":"2017-08-10T07:50:27.274Z","1.0.1":"2017-07-29T20:21:19.553Z","1.0.0":"2017-07-28T21:33:36.430Z"},"users":{},"author":{"name":"Olli Vanhoja"},"repository":{"type":"git","url":"git+https://github.com/vercel/async-sema.git"},"versions":{"3.1.1":{"name":"async-sema","version":"3.1.1","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/vercel/async-sema.git"},"author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/vercel/async-sema","bugs":{"url":"https://github.com/vercel/async-sema/issues"},"license":"MIT","main":"lib/index.js","scripts":{"build":"tsc","lint:staged":"lint-staged","prepublishOnly":"yarn build","prettier":"prettier --write --single-quote './{src,test}/**/*.ts'","test":"jest"},"devDependencies":{"@types/jest":"27.0.1","@types/node":"16.6.1","jest":"27.0.6","lint-staged":"11.1.2","pre-commit":"1.2.2","prettier":"2.3.2","ts-jest":"27.0.4","typescript":"4.3.5"},"pre-commit":"lint:staged","lint-staged":{"*.{js,ts}":["prettier --write --single-quote","git add"]},"jest":{"preset":"ts-jest","verbose":false,"testURL":"http://localhost/"},"gitHead":"603842b82e68e24b76eb0e74dae66de1eda468b4","_id":"async-sema@3.1.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"e527c08758a0f8f6f9f15f799a173ff3c40ea808","size":5259,"noattachment":false,"key":"/async-sema/-/async-sema-3.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-3.1.1.tgz"},"_npmUser":{"name":"leerobinson","email":"lrobinson2011@gmail.com"},"directories":{},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_3.1.1_1629209292561_0.8377035941728019"},"_hasShrinkwrap":false,"publish_time":1629209292703,"_cnpm_publish_time":1629209292703,"_cnpmcore_publish_time":"2021-12-17T00:17:23.299Z"},"3.1.0":{"name":"async-sema","version":"3.1.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/zeit/async-sema","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"license":"MIT","main":"lib/index.js","scripts":{"build":"tsc","lint:staged":"lint-staged","prepublishOnly":"yarn build","prettier":"prettier --write --single-quote './{src,test}/**/*.ts'","test":"jest"},"devDependencies":{"@types/jest":"24.0.18","@types/node":"12.7.5","jest":"24.9.0","lint-staged":"9.2.5","pre-commit":"1.2.2","prettier":"1.18.2","ts-jest":"24.1.0","typescript":"3.6.3"},"pre-commit":"lint:staged","lint-staged":{"*.{js,ts}":["prettier --write --single-quote","git add"]},"jest":{"preset":"ts-jest","verbose":false,"testURL":"http://localhost/"},"gitHead":"0c9d33702a31d8a5498c5a4183a099be3917de5e","_id":"async-sema@3.1.0","_nodeVersion":"12.11.1","_npmVersion":"6.11.3","dist":{"shasum":"3a813beb261e4cc58b19213916a48e931e21d21e","size":5294,"noattachment":false,"key":"/async-sema/-/async-sema-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-3.1.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmUser":{"name":"olliv","email":"olli.vanhoja@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_3.1.0_1576876333664_0.4688474746532174"},"_hasShrinkwrap":false,"publish_time":1576876333749,"_cnpm_publish_time":1576876333749,"_cnpmcore_publish_time":"2021-12-17T00:17:23.525Z"},"3.0.1":{"name":"async-sema","version":"3.0.1","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/zeit/async-sema","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"license":"MIT","main":"lib/index.js","scripts":{"build":"tsc","lint:staged":"lint-staged","prepublishOnly":"yarn build","prettier":"prettier --write --single-quote './{src,test}/**/*.ts'","test":"jest"},"devDependencies":{"@types/jest":"24.0.4","@types/node":"11.9.3","jest":"24.1.0","lint-staged":"8.1.3","pre-commit":"1.2.2","prettier":"1.16.4","ts-jest":"24.0.2","typescript":"3.3.3"},"pre-commit":"lint:staged","lint-staged":{"*.{js,ts}":["prettier --write --single-quote","git add"]},"jest":{"preset":"ts-jest","verbose":false,"testURL":"http://localhost/"},"gitHead":"e1e2bb535207312b71ac0f916a5335d700ffd45e","_id":"async-sema@3.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"404225197ea43e3be91ac7d711fb7088f2469c79","size":5182,"noattachment":false,"key":"/async-sema/-/async-sema-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-3.0.1.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_3.0.1_1566578194133_0.028991269792072005"},"_hasShrinkwrap":false,"publish_time":1566578194288,"_cnpm_publish_time":1566578194288,"_cnpmcore_publish_time":"2021-12-17T00:17:24.005Z"},"3.0.0":{"name":"async-sema","version":"3.0.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/zeit/async-sema","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"license":"MIT","main":"lib/index.js","scripts":{"build":"tsc","lint:staged":"lint-staged","prepublishOnly":"yarn build","prettier":"prettier --write --single-quote './{src,test}/**/*.ts'","test":"jest"},"devDependencies":{"@types/jest":"24.0.4","@types/node":"11.9.3","jest":"24.1.0","lint-staged":"8.1.3","pre-commit":"1.2.2","prettier":"1.16.4","ts-jest":"23.10.5","typescript":"3.3.3"},"pre-commit":"lint:staged","lint-staged":{"*.{js,ts}":["prettier --write --single-quote","git add"]},"jest":{"preset":"ts-jest","verbose":false,"testURL":"http://localhost/"},"gitHead":"0b90cb8577cc8cd6b67b2c65816e1488c35360d0","_id":"async-sema@3.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"9e22d6783f0ab66a1cf330e21a905e39b3b3a975","size":5184,"noattachment":false,"key":"/async-sema/-/async-sema-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-3.0.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_3.0.0_1551072372994_0.08934238780986647"},"_hasShrinkwrap":false,"publish_time":1551072373186,"_cnpm_publish_time":1551072373186,"_cnpmcore_publish_time":"2021-12-17T00:17:24.243Z"},"2.2.0":{"name":"async-sema","version":"2.2.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/zeit/async-sema","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"gitHead":"5d66867b5eb9fff6c7a8b97ec44391666605168f","_id":"async-sema@2.2.0","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"b0de2bb11a2560d369aca975d24650cc05304979","size":4789,"noattachment":false,"key":"/async-sema/-/async-sema-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-2.2.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_2.2.0_1550853956533_0.9973179729824613"},"_hasShrinkwrap":false,"publish_time":1550853956688,"_cnpm_publish_time":1550853956688,"_cnpmcore_publish_time":"2021-12-17T00:17:24.448Z"},"2.1.4":{"name":"async-sema","version":"2.1.4","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/zeit/async-sema","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"2de48bdee0217996f5b28fef2b005c35ccdeaed5","_id":"async-sema@2.1.4","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"3f5aa091d0a763354045ee899a5d17ffb69251af","size":3914,"noattachment":false,"key":"/async-sema/-/async-sema-2.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-2.1.4.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_2.1.4_1538764602798_0.18128682704259425"},"_hasShrinkwrap":false,"publish_time":1538764602969,"_cnpm_publish_time":1538764602969,"_cnpmcore_publish_time":"2021-12-17T00:17:24.672Z"},"2.1.3":{"name":"async-sema","version":"2.1.3","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/zeit/async-sema","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"f9cccfafa80e8c3b17cb20ff61d95cd4d47e2cc4","_id":"async-sema@2.1.3","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"33cf8d2d5b7530ad99c48931f2e71ab686542745","size":3177,"noattachment":false,"key":"/async-sema/-/async-sema-2.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-2.1.3.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_2.1.3_1537769940569_0.13125123063547917"},"_hasShrinkwrap":false,"publish_time":1537769940714,"_cnpm_publish_time":1537769940714,"_cnpmcore_publish_time":"2021-12-17T00:17:24.851Z"},"2.1.2":{"name":"async-sema","version":"2.1.2","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"Olli Vanhoja"},"keywords":["semaphore","async","await"],"homepage":"https://github.com/zeit/async-sema","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"files":["index.js","rate-limit.js","index.d.ts"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"2ab62c51640ceb7e0d1d52b0783cf56b408165a2","_id":"async-sema@2.1.2","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"6cb6be7027352aa637cd5a36273084d53dbb9a73","size":3172,"noattachment":false,"key":"/async-sema/-/async-sema-2.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-2.1.2.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_2.1.2_1532121984241_0.20115591313571746"},"_hasShrinkwrap":false,"publish_time":1532121984289,"_cnpm_publish_time":1532121984289,"_cnpmcore_publish_time":"2021-12-17T00:17:25.174Z"},"2.1.1":{"name":"async-sema","version":"2.1.1","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js","rate-limit.js","index.d.ts"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"b279c180d5e16aca4a3f10194302851aa62d21e0","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@2.1.1","_npmVersion":"6.0.0","_nodeVersion":"9.0.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"875e38dc896e737a01cb65598dd696707dd8d0dd","size":3072,"noattachment":false,"key":"/async-sema/-/async-sema-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-2.1.1.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_2.1.1_1528899597317_0.18414938005670223"},"_hasShrinkwrap":false,"publish_time":1528899597398,"_cnpm_publish_time":1528899597398,"_cnpmcore_publish_time":"2021-12-17T00:17:25.478Z"},"2.1.0":{"name":"async-sema","version":"2.1.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js","rate-limit.js","index.d.ts"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"32ab8b3cf984c66479f2cefdd347c2d991594d7c","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@2.1.0","_npmVersion":"6.0.0","_nodeVersion":"9.0.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"99bcc2f152187ce83ae68e62be761d48ac602c46","size":2893,"noattachment":false,"key":"/async-sema/-/async-sema-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-2.1.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_2.1.0_1526568803884_0.3899508767149902"},"_hasShrinkwrap":false,"publish_time":1526568804059,"_cnpm_publish_time":1526568804059,"_cnpmcore_publish_time":"2021-12-17T00:17:25.713Z"},"2.0.0":{"name":"async-sema","version":"2.0.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js","rate-limit.js","index.d.ts"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"d030502830bf17bc3e1948fafe16305c7b8d2a94","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.8.0","_npmUser":{"name":"leo","email":"leo@zeit.co"},"dist":{"shasum":"f94e308c04e947eff015e4bf75cd96c8c153d1aa","size":2852,"noattachment":false,"key":"/async-sema/-/async-sema-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-2.0.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema_2.0.0_1521408182686_0.2642288998203217"},"_hasShrinkwrap":false,"publish_time":1521408182737,"_cnpm_publish_time":1521408182737,"_cnpmcore_publish_time":"2021-12-17T00:17:25.920Z"},"1.4.1":{"name":"async-sema","version":"1.4.1","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js","rate-limit.js","index.d.ts"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"8cf24acdeac3a5667df49699e82325b0e7adc0b1","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.4.1","_npmVersion":"5.5.1","_nodeVersion":"9.0.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"6b01d56b4bfbd5364a2cada0a6569516d57a5cbb","size":2760,"noattachment":false,"key":"/async-sema/-/async-sema-1.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.4.1.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.4.1.tgz_1516569931101_0.4665207453072071"},"directories":{},"publish_time":1516569931215,"_hasShrinkwrap":false,"_cnpm_publish_time":1516569931215,"_cnpmcore_publish_time":"2021-12-17T00:17:26.147Z"},"1.4.0":{"name":"async-sema","version":"1.4.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","types":"index.d.ts","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js","rate-limit.js"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"ada1ad5278aedc32db026474688704e195d26964","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.4.0","_npmVersion":"5.5.1","_nodeVersion":"9.0.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"d9325ef7b71696b61b800d8de2913f4767b9daac","size":2570,"noattachment":false,"key":"/async-sema/-/async-sema-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.4.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.4.0.tgz_1516439399979_0.31304796878248453"},"directories":{},"publish_time":1516439400108,"_hasShrinkwrap":false,"_cnpm_publish_time":1516439400108,"_cnpmcore_publish_time":"2021-12-17T00:17:26.395Z"},"1.3.0":{"name":"async-sema","version":"1.3.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js","rate-limit.js"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"f999abf32415dfd77564d95f3933bd1c9e922df7","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.3.0","_npmVersion":"5.5.1","_nodeVersion":"9.0.0","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"7d843a0beee56db43a5584365e856fe697e6522c","size":2552,"noattachment":false,"key":"/async-sema/-/async-sema-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.3.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.3.0.tgz_1516378883521_0.4505087716970593"},"directories":{},"publish_time":1516378883602,"_hasShrinkwrap":false,"_cnpm_publish_time":1516378883602,"_cnpmcore_publish_time":"2021-12-17T00:17:26.598Z"},"1.2.0":{"name":"async-sema","version":"1.2.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"19c60b1e4c869f160d09d1cc5df03bf4d132ef88","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.2.0","_npmVersion":"5.2.0","_nodeVersion":"8.2.1","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"b1d5a59a7cd92596a5f6569ac4174d2c9c2d6900","size":2427,"noattachment":false,"key":"/async-sema/-/async-sema-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.2.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.2.0.tgz_1506674637999_0.8824148667044938"},"directories":{},"publish_time":1506674638262,"_hasShrinkwrap":false,"_cnpm_publish_time":1506674638262,"_cnpmcore_publish_time":"2021-12-17T00:17:26.827Z"},"1.1.0":{"name":"async-sema","version":"1.1.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"7a9e51f9b515a641ed0636b173be716ef61ae215","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"leo","email":"leo@zeit.co"},"dist":{"shasum":"594ab57106363c2fa7f212a2a8764510eb4d1029","size":2437,"noattachment":false,"key":"/async-sema/-/async-sema-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.1.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.1.0.tgz_1502352143634_0.04176740348339081"},"directories":{},"publish_time":1502352144523,"_hasShrinkwrap":false,"_cnpm_publish_time":1502352144523,"_cnpmcore_publish_time":"2021-12-17T00:17:27.047Z"},"1.0.2":{"name":"async-sema","version":"1.0.2","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","author":{"name":"hbp"},"keywords":["semaphore","async","await"],"files":["index.js"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"5e96c33bf30fea71ac33d60662c2ebf5a342752f","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"olliv","email":"olli@zeit.co"},"dist":{"shasum":"7379c17cb09bec31d93f2d711cbd9f5fc444d2e4","size":2310,"noattachment":false,"key":"/async-sema/-/async-sema-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.0.2.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.0.2.tgz_1502351427197_0.7254236121661961"},"directories":{},"publish_time":1502351427274,"_hasShrinkwrap":false,"_cnpm_publish_time":1502351427274,"_cnpmcore_publish_time":"2021-12-17T00:17:27.252Z"},"1.0.1":{"name":"async-sema","version":"1.0.1","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","author":{"name":"hbp"},"files":["index.js"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"4b9bf52c72abfafdb75e50bd945840108567e476","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"leo","email":"leo@zeit.co"},"dist":{"shasum":"fc8a8695de4219e19521a60da14151b25fc3cf2a","size":2284,"noattachment":false,"key":"/async-sema/-/async-sema-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.0.1.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.0.1.tgz_1501359678585_0.9087016060948372"},"directories":{},"publish_time":1501359679553,"_hasShrinkwrap":false,"_cnpm_publish_time":1501359679553,"_cnpmcore_publish_time":"2021-12-17T00:17:27.463Z"},"1.0.0":{"name":"async-sema","version":"1.0.0","description":"Semaphore using `async` and `await`","repository":{"type":"git","url":"git+https://github.com/zeit/async-sema.git"},"license":"MIT","main":"index.js","author":{"name":"hbp"},"files":["index.js"],"dependencies":{"double-ended-queue":"2.1.0-0"},"gitHead":"673b48351f4def449a7db41fcbdef074b107145b","bugs":{"url":"https://github.com/zeit/async-sema/issues"},"homepage":"https://github.com/zeit/async-sema#readme","_id":"async-sema@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"leo","email":"leo@zeit.co"},"dist":{"shasum":"639d24bdfc9dced397dd594db14afb92c4cc307b","size":2365,"noattachment":false,"key":"/async-sema/-/async-sema-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-sema/download/async-sema-1.0.0.tgz"},"maintainers":[{"name":"leo","email":"799947425@qq.com"},{"name":"olliv","email":"olli@zeit.co"},{"name":"vercel-release-bot","email":""},{"name":"zeit-bot","email":"arunoda@zeit.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-sema-1.0.0.tgz_1501277615410_0.2595387315377593"},"directories":{},"publish_time":1501277616430,"_hasShrinkwrap":false,"_cnpm_publish_time":1501277616430,"_cnpmcore_publish_time":"2021-12-17T00:17:27.724Z"}},"readme":"# async-sema\n\nThis is a semaphore implementation for use with `async` and `await`. The\nimplementation follows the traditional definition of a semaphore rather than the\ndefinition of an asynchronous semaphore seen in some js community examples.\nWhere as the latter one generally allows every defined task to proceed\nimmediately and synchronizes at the end, async-sema allows only a selected\nnumber of tasks to proceed at once while the rest will remain waiting.\n\nAsync-sema manages the semaphore count as a list of tokens instead of a single\nvariable containing the number of available resources. This enables an\ninteresting application of managing the actual resources with the semaphore\nobject itself. To make it practical the constructor for Sema includes an option\nfor providing an init function for the semaphore tokens. Use of a custom token\ninitializer is demonstrated in `examples/pooling.js`.\n\n## Usage\n\nFirstly, add the package to your project's `dependencies`:\n\n```bash\nnpm install --save async-sema\n```\n\nor\n\n```bash\nyarn add async-sema\n```\n\nThen start using it like shown in the following example. Check more\nuse case examples [here](./examples).\n\n## Example\n\n```js\nconst { Sema } = require('async-sema');\nconst s = new Sema(\n  4, // Allow 4 concurrent async calls\n  {\n    capacity: 100 // Prealloc space for 100 tokens\n  }\n);\n\nasync function fetchData(x) {\n  await s.acquire()\n  try {\n    console.log(s.nrWaiting() + ' calls to fetch are waiting')\n    // ... do some async stuff with x\n  } finally {\n    s.release();\n  }\n}\n\nconst data = await Promise.all(array.map(fetchData));\n```\n\nThe package also offers a simple rate limiter utilizing the semaphore\nimplementation.\n\n```js\nconst { RateLimit } = require('async-sema');\n\nasync function f() {\n  const lim = RateLimit(5); // rps\n\n  for (let i = 0; i < n; i++) {\n    await lim();\n    // ... do something async\n  }\n}\n```\n\n## API\n\n### Sema\n\n#### Constructor(nr, { initFn, pauseFn, resumeFn, capacity })\n\nCreates a semaphore object. The first argument is mandatory and the second\nargument is optional.\n\n- `nr` The maximum number of callers allowed to acquire the semaphore\n  concurrently.\n- `initFn` Function that is used to initialize the tokens used to manage\n  the semaphore. The default is `() => '1'`.\n- `pauseFn` An optional fuction that is called to opportunistically request\n  pausing the the incoming stream of data, instead of piling up waiting\n  promises and possibly running out of memory.\n  See [examples/pausing.js](./examples/pausing.js).\n- `resumeFn` An optional function that is called when there is room again\n  to accept new waiters on the semaphore. This function must be declared\n  if a `pauseFn` is declared.\n- `capacity` Sets the size of the preallocated waiting list inside the\n  semaphore. This is typically used by high performance where the developer\n  can make a rough estimate of the number of concurrent users of a semaphore.\n\n#### async drain()\n\nDrains the semaphore and returns all the initialized tokens in an array.\nDraining is an ideal way to ensure there are no pending async tasks, for\nexample before a process will terminate.\n\n#### nrWaiting()\n\nReturns the number of callers waiting on the semaphore, i.e. the number of\npending promises.\n\n#### tryAcquire()\n\nAttempt to acquire a token from the semaphore, if one is available immediately.\nOtherwise, return `undefined`.\n\n#### async acquire()\n\nAcquire a token from the semaphore, thus decrement the number of available\nexecution slots. If `initFn` is not used then the return value of the function\ncan be discarded.\n\n#### release(token)\n\nRelease the semaphore, thus increment the number of free execution slots. If\n`initFn` is used then the `token` returned by `acquire()` should be given as\nan argument when calling this function.\n\n### RateLimit(rps, { timeUnit, uniformDistribution })\n\nCreates a rate limiter function that blocks with a promise whenever the rate\nlimit is hit and resolves the promise once the call rate is within the limit\nset by `rps`. The second argument is optional.\n\nThe `timeUnit` is an optional argument setting the width of the rate limiting\nwindow in milliseconds. The default `timeUnit` is `1000 ms`, therefore making\nthe `rps` argument act as requests per second limit.\n\nThe `uniformDistribution` argument enforces a discrete uniform distribution over\ntime, instead of the default that allows hitting the function `rps` time and\nthen pausing for `timeWindow` milliseconds. Setting the `uniformDistribution`\noption is mainly useful in a situation where the flow of rate limit function\ncalls is continuous and and occuring faster than `timeUnit` (e.g. reading a\nfile) and not enabling it would cause the maximum number of calls to resolve\nimmediately (thus exhaust the limit immediately) and therefore the next bunch\ncalls would need to wait for `timeWindow` milliseconds. However if the flow is\nsparse then this option may make the\ncode run slower with no advantages.\n\n## Contributing\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device\n2. Move into the directory of the clone: `cd async-sema`\n3. Link it to the global module directory of Node.js: `npm link`\n\nInside the project where you want to test your clone of the package, you can now either use `npm link async-sema` to link the clone to the local dependencies.\n\n## Author\n\nOlli Vanhoja ([@OVanhoja](https://twitter.com/OVanhoja))\n","_attachments":{},"homepage":"https://github.com/vercel/async-sema","bugs":{"url":"https://github.com/vercel/async-sema/issues"},"license":"MIT"}