{"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":{"integrity":"sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==","shasum":"304ec51631c3b770c65c6c6f76938b384000f4d5","tarball":"http://registry-npm.ywwl.com/throttleit/download/throttleit-1.0.1.tgz","fileCount":8,"unpackedSize":4623,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID8y8wqi7eUWJJ8NwaTse/N+/pI1fEo4pQIFk9InXVXmAiEA071YBcAZJjbbEhc6szz/5MOe8SDUD4tgWjjJY8gVOMQ="}],"size":1951,"noattachment":false,"key":"/throttleit/-/throttleit-1.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"coreh","email":"thecoreh@gmail.com"},{"name":"swatinem","email":"arpad.borsos@googlemail.com"},{"name":"timaschew","email":"timaschew@gmail.com"},{"name":"anthonyshort","email":"antshort@gmail.com"},{"name":"ianstormtaylor","email":"ian@ianstormtaylor.com"},{"name":"cristiandouce","email":"cristiandouce@gmail.com"},{"name":"stagas","email":"gstagas@gmail.com"},{"name":"rauchg","email":"rauchg@gmail.com"},{"name":"kelonye","email":"kelonyemitchel@gmail.com"},{"name":"amasad","email":"amjad.masad@gmail.com"},{"name":"trevorgerhardt","email":"trevorgerhardt@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"dominicbarnes","email":"dominic@segment.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"mattmueller","email":"mattmuelle@gmail.com"},{"name":"tootallnate","email":"nathan@tootallnate.net"},{"name":"yields","email":"yields@icloud.com"},{"name":"stephenmathieson","email":"me@stephenmathieson.com"},{"name":"retrofox","email":"rdsuarez@gmail.com"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},{"name":"calvinfo","email":"calvin@calv.info"},{"name":"defunctzombie","email":"shtylman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/throttleit_1.0.1_1700217160688_0.5627558231401293"},"_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","publish_time":1700217160881,"_cnpm_publish_time":1700217160881,"dist-tags":{"latest":"3.0.0"}}