{"_id":"leaky-bucket-queue","_rev":"3-a03261cc7e472d19ec99b0cb5e86a545","time":{"0.0.1":"2019-09-05T14:23:06.609Z","created":"2019-09-06T14:44:15.648Z","0.0.2":"2019-09-06T14:44:15.772Z","modified":"2022-05-07T18:54:15.313Z"},"name":"leaky-bucket-queue","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.2":{"name":"leaky-bucket-queue","version":"0.0.2","description":"An implementation of burstable throtling algorithm on top of rxjs","main":"lib/cjs/index.js","module":"lib/es/index.js","scripts":{"build":"npm-run-all --parallel build:cjs build:es","build:cjs":"tsc","build:es":"tsc -p tsconfig.es.json","build:prod":"npm-run-all -p build:prod:*","build:prod:cjs":"tsc --incremental false","build:prod:es":"tsc -p tsconfig.es.json --incremental false","clean":"rimraf lib","clean:cjs":"rimraf lib/cjs","clean:es":"rimraf lib/es","coverage":"npm run test -- --coverage","lint":"eslint ./src/**/*.ts","test":"jest --runInBand","test:watch":"npm run test -- --watch --runInBand","test:debug":"node --inspect-brk ./node_modules/jest/bin/jest.js --watchAll --runInBand","prepack":"npm-run-all clean build:prod"},"keywords":["leaky","bucket","leaky bucket","leaky-bucket","rate","rate-control","rate-limit","throtle","throtling","queue"],"author":{"name":"Sean P.L. WONG"},"license":"MIT","devDependencies":{"@types/jest":"^24.0.18","@typescript-eslint/eslint-plugin":"^2.0.0","@typescript-eslint/parser":"^2.0.0","eslint":"^6.2.2","jest":"^24.9.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","ts-jest":"^24.0.2","typescript":"^3.5.3"},"dependencies":{"rxjs":"^6.5.2"},"gitHead":"48ec6205e71e4dd7e862764ca447d604963f3f29","_id":"leaky-bucket-queue@0.0.2","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-JFbLC57TXZrqwixX/2ZwaORCF71PUkKJF/7MIA1LFayKvVNk2siVAsJDoWtXiNQhc/ODLL6G3ZR+pYzr2sax5Q==","shasum":"4f71b1c246b99a520cf5bc686d2988806ccaf722","tarball":"https://registry.npmjs.org/leaky-bucket-queue/-/leaky-bucket-queue-0.0.2.tgz","fileCount":21,"unpackedSize":22229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcnDACRA9TVsSAnZWagAAp6kP/2kD7hZlNGNRgHmWQjZN\nmvsKUl3470ifxvhn9XGBciaINYwNAqFHeGaWG+/KP0Hlzc4+Vd35zn0mNSpU\nVx0NMvET8obK/Pro46X2XM6ykDU9VI+4mlmNciYPC+mgpbnTWiwimwFP4ZxH\nDTcPHyxXiimQqlj6FPvFvqD/7SnlJnGfj6tRa+EhAXtB6ahCSpajTjP+9UTm\ngZJz5kPd23e+JW8+6rGxdU7545dkL9UXiNRg6Zs49mU/2zAXxTz2bT1kyTjp\nzXpHrwsHgxd4jdRILgkoYWmSEng1U+AqbsZbdf4YZ4p6xGp8fgz8GsBamxOg\nNqcuPtiTxzpRZXmpGG7/W57kK1b8U7UZ+IkLUOdX9JTSGBQNj3kc073th39S\nwITbPI+quLr1F9w2Y4RP2hu20JXlMd4HdJHUx6uZ9r70GdtK0+5KsgtGiHuW\n55eIo4Hx1Uj0nCPAfo+VPDaUKck2mSBoQZQ6PDruBA5Z3dwQr5MWkOLrnmmF\n9m6b59mosz7/HyCX5F5ob9ANAWAZ1nRA8GMEKHnpTaouRFuX5a7nBQ7/OriC\nW6+1K/Bz1Vt5sXVAxQP084f+PQxCyB+Z2OasOuBHGlEgRFWXaZH7g0l1dKpn\nm77c2n4BcU5GOUJlh5wV7Gf/Q79b0zjXlQkXmxbJ4HaLv0gCEwGkl7t9CGVN\n4htU\r\n=/LHf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIcXii7u6oUB4SFdgz9/KtTEs6lWWQQA/tDY6IfVozbAiAGqr69pm1F43C0EuKEVOCeNqNH9Utx+law/7ugrkEn+g=="}]},"maintainers":[{"name":"seanplwong","email":"seanplwong@gmail.com"}],"_npmUser":{"name":"seanplwong","email":"seanplwong@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/leaky-bucket-queue_0.0.2_1567781055648_0.5904124468444496"},"_hasShrinkwrap":false}},"maintainers":[{"name":"seanplwong","email":"seanplwong@gmail.com"}],"description":"An implementation of burstable throtling algorithm on top of rxjs","keywords":["leaky","bucket","leaky bucket","leaky-bucket","rate","rate-control","rate-limit","throtle","throtling","queue"],"author":{"name":"Sean P.L. WONG"},"license":"MIT","readme":"# leaky-bucket-queue\r\n\r\nAn implementation of leaky bucket on top of `rxjs`.\r\n\r\nSimple rate limiting are usually good enough for most scenario but they might incur unnecessary stuttering when there is attempt to make multiple call to a server API.\r\nLeaky bucket provides a burstable solution, providing rate limit while allowing bursty traffic,\r\nmaking application more responsive.\r\n\r\n## Installation\r\n\r\n```\r\nnpm i leaky-bucket-queue\r\n```\r\n\r\n## Usage\r\n\r\n### Typescript\r\n\r\n```ts\r\nimport { LeakyBucketQueue } from 'leaky-bucket-queue';\r\n\r\nconst queue = new LeakyBucketQueue<string>({ burstSize: 5, period: 100 });\r\nqueue.consume().subscribe({\r\n  next: console.log,\r\n});\r\nqueue.enqueue('compter');\r\n...\r\n```\r\n\r\n### JavaScript\r\n\r\n```js\r\nimport { LeakyBucketQueue } from 'leaky-bucket-queue';\r\n\r\nconst queue = new LeakyBucketQueue({ burstSize: 5, period: 100 });\r\nqueue.consume().subscribe({\r\n  next: console.log,\r\n});\r\nqueue.enqueue('explode');\r\n...\r\n```\r\n","readmeFilename":"README.md"}