{"_id":"limiter","_rev":"327477","name":"limiter","description":"A generic rate limiter for the web and node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"time":{"modified":"2021-06-07T02:45:05.000Z","created":"2012-04-17T00:38:05.679Z","2.1.0":"2021-05-19T21:37:38.037Z","2.0.1":"2021-04-30T17:54:06.177Z","2.0.0":"2021-04-28T23:25:12.177Z","1.1.5":"2020-01-08T00:33:43.583Z","1.1.4":"2019-01-14T00:59:58.988Z","1.1.3":"2018-04-17T05:00:59.538Z","1.1.2":"2017-06-24T21:32:12.019Z","1.1.1":"2017-06-22T07:04:11.388Z","1.1.0":"2015-10-28T17:43:46.389Z","1.0.5":"2013-12-31T20:38:01.470Z","1.0.4":"2013-08-02T03:47:13.585Z","1.0.3":"2013-03-20T19:00:10.384Z","1.0.2":"2013-02-26T17:14:37.773Z","1.0.1":"2013-02-26T06:39:53.518Z","1.0.0":"2012-07-17T20:10:01.194Z","0.0.2":"2012-04-17T00:38:05.679Z"},"users":{"joakin":true,"zeke":true,"mimmo1":true,"shahzaib":true,"robruffler":true,"markthethomas":true,"cliff":true,"jpepe":true,"tarkeshwar":true,"panlw":true,"andersonsantos":true,"milfromoz":true,"gihankarunarathne":true,"blitzprog":true,"spiros.politis":true,"djjaron":true,"ahsanshafiq":true,"maxidev":true,"jovinbm":true,"joypeterson":true,"scotchulous":true,"firerishi":true,"quocnguyen":true,"markstos":true,"shanewholloway":true,"meeh":true,"junjiansyu":true,"ferx":true,"arcticicestudio":true,"gamersdelight":true},"author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"versions":{"2.1.0":{"name":"limiter","description":"A generic rate limiter for the web and node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"2.1.0","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","browser":"./dist/esm/index.js","exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"license":"MIT","scripts":{"lint":"eslint --fix src","prepack":"yarn ttsc -p tsconfig.json && ttsc -p tsconfig.cjs.json","test":"jest src"},"dependencies":{"just-performance":"4.3.0"},"devDependencies":{"@babel/core":"^7.13.16","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@types/babel__generator":"^7.6.2","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^26.6.3","eslint":"^7.25.0","eslint-plugin-prettier":"^3.4.0","jest":"^26.6.3","prettier":"^2.2.1","ttypescript":"^1.5.12","typescript":"^4.2.4"},"keywords":["rate","limiting","throttling"],"gitHead":"f448369e0cf1a66e014888d11641bce35c623954","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@2.1.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"d38d7c5b63729bb84fb0c4d8594b7e955a5182a2","size":32778,"noattachment":false,"key":"/limiter/-/limiter-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-2.1.0.tgz"},"_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"directories":{},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter_2.1.0_1621460257894_0.6387654443970874"},"_hasShrinkwrap":false,"publish_time":1621460258037,"_cnpm_publish_time":1621460258037},"2.0.1":{"name":"limiter","description":"A generic rate limiter for the web and node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"2.0.1","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"type":"module","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","browser":"./dist/esm/index.js","exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"license":"MIT","scripts":{"lint":"eslint --fix src","prepack":"yarn ttsc -p tsconfig.json && ttsc -p tsconfig.cjs.json","test":"jest src"},"dependencies":{"just-performance":"4.2.0"},"devDependencies":{"@babel/core":"^7.13.16","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@types/babel__generator":"^7.6.2","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","@zoltu/typescript-transformer-append-js-extension":"^1.0.1","babel-jest":"^26.6.3","eslint":"^7.25.0","eslint-plugin-prettier":"^3.4.0","jest":"^26.6.3","prettier":"^2.2.1","ttypescript":"^1.5.12","typescript":"^4.2.4"},"keywords":["rate","limiting","throttling"],"gitHead":"d954dfee3da7ddc4fc9599001c5159492005c665","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@2.0.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"030464e800c031b7f706e27e18f77d2b04e8a4e4","size":33925,"noattachment":false,"key":"/limiter/-/limiter-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-2.0.1.tgz"},"_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"directories":{},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter_2.0.1_1619805245885_0.9400197293329025"},"_hasShrinkwrap":false,"publish_time":1619805246177,"_cnpm_publish_time":1619805246177},"2.0.0":{"name":"limiter","description":"A generic rate limiter for the web and node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"2.0.0","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"type":"module","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","browser":"./dist/esm/index.js","exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"license":"MIT","scripts":{"lint":"eslint --fix src","prepack":"yarn tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","test":"jest src"},"dependencies":{"just-performance":"4.2.0"},"devDependencies":{"@babel/core":"^7.13.16","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@types/babel__generator":"^7.6.2","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","babel-jest":"^26.6.3","eslint":"^7.25.0","eslint-plugin-prettier":"^3.4.0","jest":"^26.6.3","prettier":"^2.2.1","typescript":"^4.2.4"},"keywords":["rate","limiting","throttling"],"gitHead":"1038fc4ff4d84402e30cd004d0aabfe6db5904d1","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@2.0.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"09b47001414bd53de3b4c1d70fe1aebe8febe1ba","size":34480,"noattachment":false,"key":"/limiter/-/limiter-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-2.0.0.tgz"},"_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"directories":{},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter_2.0.0_1619652311951_0.25512713593098346"},"_hasShrinkwrap":false,"publish_time":1619652312177,"_cnpm_publish_time":1619652312177},"1.1.5":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.1.5","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"scripts":{"test":"vows --spec"},"dependencies":{},"devDependencies":{"assert":"1.3.0","vows":"0.8.1"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","types":"./index.d.ts","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"gitHead":"b8a770df02add01e51bcf05c7eb3be861cb2aebd","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@1.1.5","_nodeVersion":"12.11.1","_npmVersion":"6.13.4","dist":{"shasum":"8f92a25b3b16c6131293a0cc834b4a838a2aa7c2","size":6556,"noattachment":false,"key":"/limiter/-/limiter-1.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.1.5.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter_1.1.5_1578443623481_0.19794700927647724"},"_hasShrinkwrap":false,"publish_time":1578443623583,"_cnpm_publish_time":1578443623583},"1.1.4":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.1.4","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"scripts":{"test":"vows --spec"},"dependencies":{},"devDependencies":{"assert":"1.3.0","vows":"0.8.1"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","types":"./index.d.ts","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"gitHead":"cc0ee6134c25cb4bd206801b54984677a3f2c736","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@1.1.4","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"dist":{"shasum":"87c9c3972d389fdb0ba67a45aadbc5d2f8413bc1","size":6509,"noattachment":false,"key":"/limiter/-/limiter-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.1.4.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter_1.1.4_1547427598874_0.7060644340835409"},"_hasShrinkwrap":false,"publish_time":1547427598988,"_cnpm_publish_time":1547427598988},"1.1.3":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.1.3","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"scripts":{"test":"vows --spec"},"dependencies":{},"devDependencies":{"assert":"1.3.0","vows":"0.8.1"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","types":"./index.d.ts","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"gitHead":"00a1a79b5ad7420249485eb45552c503ac7010e6","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@1.1.3","_npmVersion":"5.8.0","_nodeVersion":"9.11.1","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"dist":{"shasum":"32e2eb55b2324076943e5d04c1185ffb387968ef","size":6508,"noattachment":false,"key":"/limiter/-/limiter-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.1.3.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter_1.1.3_1523941259481_0.17198524166166895"},"_hasShrinkwrap":false,"publish_time":1523941259538,"_cnpm_publish_time":1523941259538},"1.1.2":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.1.2","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"scripts":{"test":"vows --spec"},"dependencies":{},"devDependencies":{"assert":"1.3.0","vows":"0.8.1"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","types":"./index.d.ts","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"gitHead":"91e2d77fcb0cf25d2ee70a1f7cbdff89d1f41b75","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@1.1.2","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"dist":{"shasum":"229d8055891c8b11af9e0ee5200e8e09bb3dcbeb","size":6270,"noattachment":false,"key":"/limiter/-/limiter-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.1.2.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter-1.1.2.tgz_1498339931911_0.9144701363984495"},"publish_time":1498339932019,"_hasShrinkwrap":false,"_cnpm_publish_time":1498339932019},"1.1.1":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.1.1","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"scripts":{"test":"vows --spec"},"dependencies":{},"devDependencies":{"assert":"1.3.0","vows":"0.8.1"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","types":"./index.d.ts","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"gitHead":"110f0243d1662018b8a2e533bae9f237f3212b41","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@1.1.1","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"dist":{"shasum":"62deeb0000ebbd0ab5a85884f62a27f397864c0d","size":6237,"noattachment":false,"key":"/limiter/-/limiter-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.1.1.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/limiter-1.1.1.tgz_1498115050102_0.8171911591198295"},"publish_time":1498115051388,"_hasShrinkwrap":false,"_cnpm_publish_time":1498115051388},"1.1.0":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.1.0","author":{"name":"John Hurliman","email":"jhurliman@jhurliman.org"},"scripts":{"test":"vows --spec"},"dependencies":{},"devDependencies":{"assert":"1.3.0","vows":"0.8.1"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"gitHead":"bf4286a31db48dec2a1a0029bf2ab703dd016b12","homepage":"https://github.com/jhurliman/node-rate-limiter#readme","_id":"limiter@1.1.0","_shasum":"6e2bd12ca3fcdaa11f224e2e53c896df3f08d913","_from":".","_npmVersion":"3.3.5","_nodeVersion":"4.1.0","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"dist":{"shasum":"6e2bd12ca3fcdaa11f224e2e53c896df3f08d913","size":6012,"noattachment":false,"key":"/limiter/-/limiter-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.1.0.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1446054226389,"_cnpm_publish_time":1446054226389,"_hasShrinkwrap":false},"1.0.5":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.0.5","author":{"name":"John Hurliman","email":"jhurliman@cull.tv"},"dependencies":{},"devDependencies":{"assert":"0.4.9","vows":"0.6.3"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"readmeFilename":"README.md","_id":"limiter@1.0.5","dist":{"shasum":"9630b2a0d3bad63203f96e3d96f32f83d442dfc8","size":5700,"noattachment":false,"key":"/limiter/-/limiter-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.0.5.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1388522281470,"_cnpm_publish_time":1388522281470,"_hasShrinkwrap":false},"1.0.4":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.0.4","author":{"name":"John Hurliman","email":"jhurliman@cull.tv"},"dependencies":{},"devDependencies":{"assert":"0.4.9","vows":"0.6.3"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"readmeFilename":"README.md","_id":"limiter@1.0.4","dist":{"shasum":"441aea9385f807681e29bb606eb6e6bd05f6bd82","size":5371,"noattachment":false,"key":"/limiter/-/limiter-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.0.4.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1375415233585,"_cnpm_publish_time":1375415233585,"_hasShrinkwrap":false},"1.0.3":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.0.3","author":{"name":"John Hurliman","email":"jhurliman@cull.tv"},"dependencies":{},"devDependencies":{"assert":"0.4.9","vows":"0.6.3"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"_id":"limiter@1.0.3","dist":{"shasum":"160e7d2c614d05c735d24dc33ccc12a836d1b07a","size":5377,"noattachment":false,"key":"/limiter/-/limiter-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.0.3.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1363806010384,"_cnpm_publish_time":1363806010384,"_hasShrinkwrap":false},"1.0.2":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.0.2","author":{"name":"John Hurliman","email":"jhurliman@cull.tv"},"dependencies":{},"devDependencies":{"assert":"0.4.9","vows":"0.6.3"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"_id":"limiter@1.0.2","dist":{"shasum":"dd89358fccd22facf8372b2f922e4bf33e503d52","size":5245,"noattachment":false,"key":"/limiter/-/limiter-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.0.2.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1361898877773,"_cnpm_publish_time":1361898877773,"_hasShrinkwrap":false},"1.0.1":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.0.1","author":{"name":"John Hurliman","email":"jhurliman@cull.tv"},"dependencies":{},"devDependencies":{"assert":"0.4.9","vows":"0.6.3"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"_id":"limiter@1.0.1","dist":{"shasum":"72b87782ca42a2a8adc1064aa718c22596c8a7aa","size":4852,"noattachment":false,"key":"/limiter/-/limiter-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.0.1.tgz"},"_npmVersion":"1.1.61","_npmUser":{"name":"jhurliman","email":"jhurliman@jhurliman.org"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1361860793518,"_cnpm_publish_time":1361860793518,"_hasShrinkwrap":false},"1.0.0":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"1.0.0","author":{"name":"John Hurliman","email":"jhurliman@cull.tv"},"dependencies":{},"devDependencies":{"assert":"0.4.9","vows":"0.6.3"},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"_id":"limiter@1.0.0","dist":{"shasum":"017dd406145e0ff058ac9b72ba2525543dda716a","size":4800,"noattachment":false,"key":"/limiter/-/limiter-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-1.0.0.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1342555801194,"_cnpm_publish_time":1342555801194,"_hasShrinkwrap":false},"0.0.2":{"name":"limiter","description":"A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled","version":"0.0.2","author":{"name":"John Hurliman","email":"jhurliman@cull.tv"},"dependencies":{},"devDependencies":{},"keywords":["rate","limiting","throttling"],"repository":{"type":"git","url":"git://github.com/jhurliman/node-rate-limiter.git"},"bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"directories":{"lib":"./lib/"},"main":"./index.js","licenses":[{"type":"MIT","url":"http://github.com/jhurliman/node-rate-limiter/raw/master/LICENSE.txt"}],"_npmUser":{"name":"jhurliman","email":"jhurliman@cull.tv"},"_id":"limiter@0.0.2","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"784da91388a1f6d9a1d056e44f8f253f1b0d9abe","size":4243,"noattachment":false,"key":"/limiter/-/limiter-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/limiter/download/limiter-0.0.2.tgz"},"maintainers":[{"name":"jhurliman","email":"jhurliman@jhurliman.org"}],"publish_time":1334623085679,"_cnpm_publish_time":1334623085679,"_hasShrinkwrap":false}},"readme":"# limiter\n\n[![Build Status](https://travis-ci.org/jhurliman/node-rate-limiter.png)](https://travis-ci.org/jhurliman/node-rate-limiter)\n[![NPM Downloads](https://img.shields.io/npm/dm/limiter.svg?style=flat)](https://www.npmjs.com/package/limiter)\n\nProvides a generic rate limiter for the web and node.js. Useful for API clients,\nweb crawling, or other tasks that need to be throttled. Two classes are exposed, \nRateLimiter and TokenBucket. TokenBucket provides a lower level interface to \nrate limiting with a configurable burst rate and drip rate. RateLimiter sits on\ntop of the token bucket and adds a restriction on the maximum number of tokens\nthat can be removed each interval to comply with common API restrictions such as\n\"150 requests per hour maximum\".\n\n## Installation\n\n    yarn install limiter\n\n## Usage\n\nA simple example allowing 150 requests per hour:\n\n```javascript\nimport { RateLimiter } from \"limiter\";\n\n// Allow 150 requests per hour (the Twitter search limit). Also understands\n// 'second', 'minute', 'day', or a number of milliseconds\nconst limiter = new RateLimiter({ tokensPerInterval: 150, interval: \"hour\" });\n\nasync function sendRequest() {\n  // This call will throw if we request more than the maximum number of requests\n  // that were set in the constructor\n  // remainingRequests tells us how many additional requests could be sent\n  // right this moment\n  const remainingRequests = await limiter.removeTokens(1);\n  callMyRequestSendingFunction(...);\n}\n```\n\nAnother example allowing one message to be sent every 250ms:\n\n```javascript\nimport { RateLimiter } from \"limiter\";\n\nconst limiter = new RateLimiter({ tokensPerInterval: 1, interval: 250 });\n\nasync function sendMessage() {\n  const remainingMessages = await limiter.removeTokens(1);\n  callMyMessageSendingFunction(...);\n}\n```\n\nThe default behaviour is to wait for the duration of the rate limiting that's\ncurrently in effect before the promise is resolved, but if you pass in\n`\"fireImmediately\": true`, the promise will be resolved immediately with\n`remainingRequests` set to -1:\n\n```javascript\nimport { RateLimiter } from \"limiter\";\n\nconst limiter = new RateLimiter({\n  tokensPerInterval: 150,\n  interval: \"hour\",\n  fireImmediately: true\n});\n\nasync function requestHandler(request, response) {\n  // Immediately send 429 header to client when rate limiting is in effect\n  const remainingRequests = await limiter.removeTokens(1);\n  if (remainingRequests < 0) {\n    response.writeHead(429, {'Content-Type': 'text/plain;charset=UTF-8'});\n    response.end('429 Too Many Requests - your IP is being rate limited');\n  } else {\n    callMyMessageSendingFunction(...);\n  }\n}\n```\n\nA synchronous method, tryRemoveTokens(), is available in both RateLimiter and\nTokenBucket. This will return immediately with a boolean value indicating if the\ntoken removal was successful.\n\n```javascript\nimport { RateLimiter } from \"limiter\";\n\nconst limiter = new RateLimiter({ tokensPerInterval: 10, interval: \"second\" });\n\nif (limiter.tryRemoveTokens(5))\n  console.log('Tokens removed');\nelse\n  console.log('No tokens removed');\n```\n\nTo get the number of remaining tokens **outside** the `removeTokens` promise,\nsimply use the `getTokensRemaining` method.\n\n```javascript\nimport { RateLimiter } from \"limiter\";\n\nconst limiter = new RateLimiter({ tokensPerInterval: 1, interval: 250 });\n\n// Prints 1 since we did not remove a token and our number of tokens per\n// interval is 1\nconsole.log(limiter.getTokensRemaining());\n```\n\nUsing the token bucket directly to throttle at the byte level:\n\n```javascript\nimport { TokenBucket } from \"limiter\";\n\nconst BURST_RATE = 1024 * 1024 * 150; // 150KB/sec burst rate\nconst FILL_RATE = 1024 * 1024 * 50; // 50KB/sec sustained rate\n\n// We could also pass a parent token bucket in to create a hierarchical token\n// bucket\n// bucketSize, tokensPerInterval, interval\nconst bucket = new TokenBucket({\n  bucketSize: BURST_RATE,\n  tokensPerInterval: FILL_RATE,\n  interval: \"second\"\n});\n\nasync function handleData(myData) {\n  await bucket.removeTokens(myData.byteLength);\n  sendMyData(myData);\n}\n```\n\n## Additional Notes\n\nBoth the token bucket and rate limiter should be used with a message queue or \nsome way of preventing multiple simultaneous calls to removeTokens(). \nOtherwise, earlier messages may get held up for long periods of time if more \nrecent messages are continually draining the token bucket. This can lead to \nout of order messages or the appearance of \"lost\" messages under heavy load.\n\n## License\n\nMIT License\n","_attachments":{},"homepage":"https://github.com/jhurliman/node-rate-limiter#readme","bugs":{"url":"http://github.com/jhurliman/node-rate-limiter/issues"},"license":"MIT"}