{"_id":"throttleit","_rev":"3373912","name":"throttleit","description":"Throttle a function to limit its execution rate","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-08-26T02:59:00.000Z","created":"2013-03-26T21:24:01.652Z","2.1.0":"2024-06-21T22:50:58.348Z","2.0.0":"2023-11-17T11:51:17.496Z","1.0.1":"2023-11-17T10:32:40.881Z","1.0.0":"2015-02-27T15:10:17.396Z","0.0.2":"2013-03-26T21:31:01.043Z","0.0.1":"2013-03-26T21:24:01.652Z"},"users":{"ash":true,"zeke":true,"roccomuso":true,"beisen":true},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/throttleit.git"},"versions":{"2.1.0":{"name":"throttleit","version":"2.1.0","description":"Throttle a function to limit its execution rate","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/throttleit.git"},"funding":"https://github.com/sponsors/sindresorhus","exports":{"types":"./index.d.ts","default":"./index.js"},"main":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["throttle","rate","limit","limited","rate-limit","ratelimit","throttling","optimization","performance","function","execution","interval","batch"],"devDependencies":{"ava":"^5.3.1","xo":"^0.56.0"},"xo":{"rules":{"unicorn/prefer-module":"off"}},"_id":"throttleit@2.1.0","gitHead":"ed1d22c70a964ef0299d0400dbfd1fbedef56a59","bugs":{"url":"https://github.com/sindresorhus/throttleit/issues"},"homepage":"https://github.com/sindresorhus/throttleit#readme","_nodeVersion":"22.2.0","_npmVersion":"10.6.0","dist":{"shasum":"a7e4aa0bf4845a5bd10daa39ea0c783f631a07b4","size":2250,"noattachment":false,"key":"/throttleit/-/throttleit-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttleit/download/throttleit-2.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/throttleit_2.1.0_1719010258168_0.8806595942049604"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-21T22:50:58.348Z","publish_time":1719010258348,"_source_registry_name":"default","maintainers":[{"name":"sindresorhus","email":""}],"_cnpm_publish_time":1719010258348},"2.0.0":{"name":"throttleit","version":"2.0.0","description":"Throttle a function to limit its execution rate","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/throttleit.git"},"funding":"https://github.com/sponsors/sindresorhus","exports":{"types":"./index.d.ts","default":"./index.js"},"main":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["throttle","rate","limit","limited","rate-limit","ratelimit","throttling","optimization","performance","function","execution","interval","batch"],"devDependencies":{"ava":"^5.3.1","xo":"^0.56.0"},"xo":{"rules":{"unicorn/prefer-module":"off"}},"gitHead":"3b06de30521b81c7fe283df279b90d0e20a8dd42","bugs":{"url":"https://github.com/sindresorhus/throttleit/issues"},"homepage":"https://github.com/sindresorhus/throttleit#readme","_id":"throttleit@2.0.0","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"shasum":"b118da15e6062ec1daf448166e9a0378807401b7","size":2122,"noattachment":false,"key":"/throttleit/-/throttleit-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttleit/download/throttleit-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/throttleit_2.0.0_1700221877293_0.2565643052159827"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-17T11:51:17.496Z","publish_time":1700221877496,"_source_registry_name":"default","_cnpm_publish_time":1700221877496},"1.0.1":{"name":"throttleit","description":"Throttle a function","version":"1.0.1","keywords":[],"funding":"https://github.com/sponsors/sindresorhus","repository":{"type":"git","url":"git://github.com/sindresorhus/throttleit.git"},"devDependencies":{"mocha":"^1.18.0"},"license":"MIT","component":{"scripts":{"throttle/index.js":"index.js"}},"scripts":{"test":"mocha --reporter spec"},"gitHead":"afb7848a9b231e90fe3b44f7d18d59821452367f","bugs":{"url":"https://github.com/sindresorhus/throttleit/issues"},"homepage":"https://github.com/sindresorhus/throttleit#readme","_id":"throttleit@1.0.1","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"shasum":"304ec51631c3b770c65c6c6f76938b384000f4d5","size":1951,"noattachment":false,"key":"/throttleit/-/throttleit-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttleit/download/throttleit-1.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/throttleit_1.0.1_1700217160688_0.5627558231401293"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-17T10:32:40.881Z","publish_time":1700217160881,"_source_registry_name":"default","_cnpm_publish_time":1700217160881},"1.0.0":{"name":"throttleit","description":"Throttle a function","version":"1.0.0","keywords":[],"repository":{"type":"git","url":"git://github.com/component/throttle.git"},"devDependencies":{"mocha":"^1.18.0"},"license":"MIT","component":{"scripts":{"throttle/index.js":"index.js"}},"scripts":{"test":"mocha --reporter spec"},"gitHead":"19f9fd95782d372f2d0be6d5c60d60f8176d7ef8","bugs":{"url":"https://github.com/component/throttle/issues"},"homepage":"https://github.com/component/throttle","_id":"throttleit@1.0.0","_shasum":"9e785836daf46743145a5984b6268d828528ac6c","_from":".","_npmVersion":"2.1.18","_nodeVersion":"1.0.2","_npmUser":{"name":"dominicbarnes","email":"dominic@dbarnes.info"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"9e785836daf46743145a5984b6268d828528ac6c","size":1978,"noattachment":false,"key":"/throttleit/-/throttleit-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttleit/download/throttleit-1.0.0.tgz"},"directories":{},"publish_time":1425049817396,"_cnpm_publish_time":1425049817396,"_hasShrinkwrap":false},"0.0.2":{"name":"throttleit","description":"Throttle a function","version":"0.0.2","keywords":[],"repository":{"type":"git","url":"git://github.com/component/throttle.git"},"dependencies":{},"development":{},"license":"MIT","component":{"scripts":{"throttle/index.js":"index.js"}},"readmeFilename":"Readme.md","_id":"throttleit@0.0.2","dist":{"shasum":"cfedf88e60c00dd9697b61fdd2a8343a9b680eaf","size":1226,"noattachment":false,"key":"/throttleit/-/throttleit-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttleit/download/throttleit-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.15","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1364333461043,"_cnpm_publish_time":1364333461043,"_hasShrinkwrap":false},"0.0.1":{"name":"throttleit","description":"Throttle a function","version":"0.0.1","keywords":[],"dependencies":{},"development":{},"license":"MIT","component":{"scripts":{"throttle/index.js":"index.js"}},"readmeFilename":"Readme.md","_id":"throttleit@0.0.1","dist":{"shasum":"c0d90d48ce5d748fec082b489af0d82e3b1167d6","size":856,"noattachment":false,"key":"/throttleit/-/throttleit-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/throttleit/download/throttleit-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1364333041652,"_cnpm_publish_time":1364333041652,"_hasShrinkwrap":false}},"readme":"# throttleit\n\n> Throttle a function to limit its execution rate\n\n## Install\n\n```sh\nnpm install throttleit\n```\n\n## Usage\n\n```js\nimport throttle from 'throttleit';\n\n// Throttling a function that processes data.\nfunction processData(data) {\n\tconsole.log('Processing:', data);\n\n\t// Add data processing logic here.\n}\n\n// Throttle the `processData` function to be called at most once every 3 seconds.\nconst throttledProcessData = throttle(processData, 3000);\n\n// Simulate calling the function multiple times with different data.\nthrottledProcessData('Data 1');\nthrottledProcessData('Data 2');\nthrottledProcessData('Data 3');\n```\n\n## API\n\n### throttle(function, wait)\n\nCreates a throttled function that limits calls to the original function to at most once every `wait` milliseconds. It guarantees execution after the final invocation and maintains the last context (`this`) and arguments.\n\n#### function\n\nType: `function`\n\nThe function to be throttled.\n\n#### wait\n\nType: `number`\n\nThe number of milliseconds to throttle invocations to.\n\n## Related\n\n- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle async functions\n- [debounce](https://github.com/sindresorhus/debounce) - Delay function calls until a set time elapses after the last invocation\n","_attachments":{},"homepage":"https://github.com/sindresorhus/throttleit#readme","bugs":{"url":"https://github.com/sindresorhus/throttleit/issues"},"license":"MIT"}