{"_id":"@26brains/throttled-queue-decorator","_rev":"3-f648f8ed37835eac6b40d78c8c2dd48b","name":"@26brains/throttled-queue-decorator","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@26brains/throttled-queue-decorator","version":"1.0.0","description":"Throttles a function to a given number per interval. Uses promises and decorates original function.","main":"throttled-queue-decorator.js","scripts":{"test":"_mocha test"},"author":{"name":"Damien Hampton","email":"damien@26brains.com"},"license":"ISC","devDependencies":{"chai":"^4.2.0","mocha":"^6.2.2"},"gitHead":"a6929ead9bfb7ac5f764a908a69bada7e0b6ce60","_id":"@26brains/throttled-queue-decorator@1.0.0","_nodeVersion":"12.4.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-DSr1Iwwp1eZL/GrdrYQPxesf88fVWyLuGYlII6g951oLBqbTGcs09/Tui0+nrM6xxaEqodzPioMLBwzIsTQJAg==","shasum":"e4005da9a3ce446614d6ad2e32d24168276331a8","tarball":"https://registry.npmjs.org/@26brains/throttled-queue-decorator/-/throttled-queue-decorator-1.0.0.tgz","fileCount":6,"unpackedSize":7698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtIL6CRA9TVsSAnZWagAAGLEP/1uhGA5P+Fl7ZmaMTn3w\nsHe37vRk3QG3p1N66RKoya4pX+mzgKu0u9QSLZagSrgbmb0wIjTd6UzJJsGw\ngGFb+M8kYQ9nMJz9UfNCcth3sfoVePYjsWRFl9qyw1eUQTP0KJQ/oVi06RdI\nYoPORymnnKuIpMBKDWzo69oq+7RTo5TZqlCyo497LjxLOkEsf5n28J8UcE4z\nq0HeH52hoZPQ7lU0OU2F/lK0VYhLeJzlRcz6WLQ7Iy/ONgUypscNd/cjOQOU\n5+dEv3j5juzPE5XH/IvMFoFFi1fTuLwF0Nft1C9IGyLoSJmm2jsJ3+fLqNj5\n+VLBU8+EmLSvQKG0SSYnJmhM3EeAJ5oc6RVfaQVRgHuonID1eLsIWYUQGylC\nkHh0nPerc4Wx9OwqswOZ4gAEhzXf9jcD+xbuWDdJRUKYseQ3MeiEiJ6CrkJu\nWo9JooAYeZCZTq26VJykC1oFT+dxiEAhPdunP/kSfbg8VH1oJKZuls80UKwb\nA62I5NotR6D0BwOlPpzUs2Hn1Dggyx7dvtnUEL232wCCpaWO1CgupedG+hK2\nXuJ3ZHvi79OOwgkz9KOELSecxQQo9vrdz9P6GzEiXEQsLwiDQhPE3WWi2wED\nCNyPiBWGaoSvRgbq8i3lBOL/oJUUlYcLJ8JIcgyMHw0EviQZ8CMWhQDJyqrx\nxo6k\r\n=IYr+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBUzFJfGI/PQoA7TYGd1AGg+bjo7iQwjhzgQukm29RtAAiBmrr29FnfGKVJO9miHVVSBZ6F02n9bOQfG5ru/kMhodA=="}]},"maintainers":[{"name":"damienhampton","email":"damien@26brains.com"}],"_npmUser":{"name":"damienhampton","email":"damien@26brains.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/throttled-queue-decorator_1.0.0_1572111098388_0.08165401890857038"},"_hasShrinkwrap":false},"1.0.1":{"name":"@26brains/throttled-queue-decorator","version":"1.0.1","description":"Throttles a function to a given number per interval. Uses promises and decorates original function.","main":"throttled-queue-decorator.js","scripts":{"test":"_mocha test"},"author":{"name":"Damien Hampton","email":"damien@26brains.com"},"license":"ISC","devDependencies":{"chai":"^4.2.0","mocha":"^6.2.2"},"gitHead":"7bc81240545347722c2fafc6247067c105e32679","_id":"@26brains/throttled-queue-decorator@1.0.1","_nodeVersion":"12.4.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-SSpJEJ5Jirt5dE584GDn6MrJVSKD7dyPpt7bRrD9h/Fs/tqi5YQkuaxFENOXM1BZRnOq52gIm+NDEJZuMeJ6Bw==","shasum":"420c7cb3f4d157fc2cbcb998ec736cfb70fbff1b","tarball":"https://registry.npmjs.org/@26brains/throttled-queue-decorator/-/throttled-queue-decorator-1.0.1.tgz","fileCount":6,"unpackedSize":7708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtIPQCRA9TVsSAnZWagAAmPkP/01gBAM0ZsAdTLI0DlgV\nJXhowp0GV30e8shIGu+WodkyEn+YN9aFi7MIfkLuR908g9iJaZEmRfxMipZh\n0vn1eIA8yTQ9Mlp8YZ2QpOWDilNW1C5j9541YnYvNSc8YDxLTolHE7Jz0tXn\nei21UY8yN1zMycA2rhyBlq9thJbQoVBYupHXTlw+SoEmEnt45VbnaR/ehnzY\nCbGyLj8knSYC88EtwXH+FMgAJcrEX869FJcV1XrWSQBVDtbr3r4vGEnCX+Ds\nOtkpVLh4QV8I63F2ECWRusN5MOe2Xui0mxahMqPiluYH3Oze04QQCg86tqhW\nI9Tye7ECqkdyReI1ycf7C5KOEk7afBnPDI1Pgeugm3sOkcbWQUZjVef3JZPc\nWhauzWj5qp0CeWUUnuPSgUgYLOz9sCZC6W11GGFxc4jyw9f5/zORFe7Tpm36\nYa7asoiow7Vye07reCoDmYc3Pe4ODkeUPozYxaquDYBSmeKelle7N/BE4guF\nDI4bFhwAyJ4eHeqoxsgxUmxa7p6twP1su674WkIwzqvc/09yIL7fDNru1jDw\nfyriixA66YwsBD89eSb42u5keUMe5gfCRU+/HjvXp9uErQQovy+rqRKsJ6tL\nL8yqyNo16eMXqDvL7lQJ5wO1i3bU/+2Xw/Yp8tenf7yXPEOGH5eVl9ySua/Q\nJznC\r\n=y7UG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCra7UYBXuR3V9nreWqe/s1mqxbOLncsP+vTyNZyy+ewgIgUqDtUj8Nc3qMEkkj8TfqyKruE9NnHTzci8pEoFUctU0="}]},"maintainers":[{"name":"damienhampton","email":"damien@26brains.com"}],"_npmUser":{"name":"damienhampton","email":"damien@26brains.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/throttled-queue-decorator_1.0.1_1572111311984_0.5399142006515052"},"_hasShrinkwrap":false},"1.0.2":{"name":"@26brains/throttled-queue-decorator","version":"1.0.2","description":"Throttles a function to a given number per interval. Uses promises and decorates original function.","main":"throttled-queue-decorator.js","scripts":{"test":"_mocha test"},"author":{"name":"Damien Hampton","email":"damien@26brains.com"},"license":"ISC","devDependencies":{"chai":"^4.2.0","mocha":"^6.2.2"},"gitHead":"eff22903ea0f4f6ad07ed82d027f4d0907dec7c4","_id":"@26brains/throttled-queue-decorator@1.0.2","_nodeVersion":"12.4.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-X+FuOPwPlsVRvAsJrZrFdgeOzFlaYe0FzFGerErA7BhjOo8nYDP1uOknMGg3ujWVhZnpLyoIdqHr0daGxDmeMA==","shasum":"a568ae9c2fd67f99e1fa04cf98acdd78bbdf65a3","tarball":"https://registry.npmjs.org/@26brains/throttled-queue-decorator/-/throttled-queue-decorator-1.0.2.tgz","fileCount":6,"unpackedSize":8105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtJ06CRA9TVsSAnZWagAAPNgQAIkfvbOpz9L2jmOzNxba\n7McfrlgK36sSTNiq/2RueBsE32jr4h2tO0ad71qAAeaGKTpYufbAk/Z8umO8\nis2E1Y+Cp2CZoWCOj8DIVFfF1eMxFbA6mDDY4JeBE308jGj1b8LnZMBaFrXM\nOZAYtExPMHK5vSaxPM4CEvCNEm5l4S3QhHxHBcKxof4pH9JuV+bvkJaRKtiJ\nMz0deeUAdPHTX17P50TW/CdnG25+gPNDBSwnUqtK87R/zjgDyluTWgrQsRuJ\nXkvA+KUb/nFfZK7JLI5r9TekLmYuvcMJw1r9wQgHOFQNOwCOdPSY4L8vhwVd\nSnjylD/I2jmo9fQXvMCOOKLATVnPvxkF8QW7tZgOQj2f/wKl5m1VaD+EaKMu\n2RLSJw+IdVyxYuqvymlSLHhl3EcWGNYtkSjGAr6rMhMIab/ja+s8g1aP83A4\nKglgw6s/iaOPOW12ImTbL3mtVeQK/xnjQaopYjwnn9dEzsVIGUoZlzbCkTYF\nIC0PxJqs3Qeihv+JkBSg4CE7alAdlrc+tShZeaIjHS7a35y5Cscj3HuqKyoE\nUUgpQ0LVXGMXoYwMyZRHWr+1p4mTjJPlSQVUB71qqjp9TjKpNr5x2NgZyVpb\nA9lUO7dQLsFRJIPFK0McPB79/GqwbwDLdbEP8Qh6XD5e/WR1xYO80W/g3UfU\nptlW\r\n=n/4m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrxYrT/IvVkMjBa0/wesvGaEMx6Zm8tCco1OoR4b6siQIgCdg1yjMeS0H8did+FrkjqLsgnBprcqnQqtOZd6JY4Gg="}]},"maintainers":[{"name":"damienhampton","email":"damien@26brains.com"}],"_npmUser":{"name":"damienhampton","email":"damien@26brains.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/throttled-queue-decorator_1.0.2_1572117817927_0.5959882950019999"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-26T17:31:38.201Z","1.0.0":"2019-10-26T17:31:38.516Z","modified":"2022-04-04T10:41:38.622Z","1.0.1":"2019-10-26T17:35:12.114Z","1.0.2":"2019-10-26T19:23:38.132Z"},"maintainers":[{"name":"damienhampton","email":"damien@26brains.com"}],"description":"Throttles a function to a given number per interval. Uses promises and decorates original function.","author":{"name":"Damien Hampton","email":"damien@26brains.com"},"license":"ISC","readme":"# Throttled Queue Decorator\n\n## Install\n`npm i @26brains/throttled-queue-decorator`\n\n## Usage\n\n```javascript\nconst { createThrottle } = require('throttled-queue-decorator');\n\nconst throttle = createThrottle(2, 1000); // 2 requests per 1000 milliseconds\n\nconst func = (id) => axios.get(`http://example.com/record/${id}`);\nconst throttledFunc = throttle(func);\n\nconst main = async () => {\n  return await Promise.all([\n    throttledFunc(1),\n    throttledFunc(2),\n    throttledFunc(3),\n  ])\n}\n//third request will be delayed by 1 second\nmain();\n```\n\n# Tests\n\n`npm test`\n\n# Example\n\n`node example/example.js`\n\n## Credits\n\nUse of single `setTimeout()` event copied from https://github.com/shaunpersad/throttled-queue.\n\n\n\n","readmeFilename":"README.md"}