{"id":18385237,"url":"https://github.com/wankdanker/node-function-rate-limit","last_synced_at":"2025-06-23T19:06:51.199Z","repository":{"id":4437479,"uuid":"5575720","full_name":"wankdanker/node-function-rate-limit","owner":"wankdanker","description":"Rate Limit any Function in node","archived":false,"fork":false,"pushed_at":"2019-01-12T22:16:35.000Z","size":10,"stargazers_count":68,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T03:43:05.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wankdanker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-27T19:14:09.000Z","updated_at":"2023-02-26T02:23:24.000Z","dependencies_parsed_at":"2022-08-31T03:12:16.095Z","dependency_job_id":null,"html_url":"https://github.com/wankdanker/node-function-rate-limit","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/wankdanker/node-function-rate-limit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-function-rate-limit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-function-rate-limit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-function-rate-limit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-function-rate-limit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wankdanker","download_url":"https://codeload.github.com/wankdanker/node-function-rate-limit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wankdanker%2Fnode-function-rate-limit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261539318,"owners_count":23174136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:16:56.970Z","updated_at":"2025-06-23T19:06:51.118Z","avatar_url":"https://github.com/wankdanker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-function-rate-limit\n--------------\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n\nLimit the execution rate of any function.\n\ninstall\n---------\n\nwith [npm](https://npmjs.org)\n\n```bash\nnpm install function-rate-limit\n```\n\napi\n----\n\n### rateLimit(limitCount, limitInterval, function);\n\nreturns a rate limited function which should be called instead of the `function` passed to `rateLimit`\n\n* _limitCount_ - the number of times per `limitInterval` to limit execution of `function`\n* _limitInterval_ - the duration of time during which to limit execution of `function` specified in ms\n* _function_ - the function which should be rate limited\n\n`function` will be called up to `limitCount` times during `limitInterval` including bursting.\n\nExample\n-------\n\n```javascript\nvar rateLimit = require('function-rate-limit');\n\n// limit to 2 executions per 1000ms\nvar start = Date.now()\nvar fn = rateLimit(2, 1000, function (x) {\n  console.log('%s ms - %s', Date.now() - start, x);\n});\n\nfor (var y = 0; y \u003c 10; y++) {\n  fn(y);\n}\n```\n\nresults in:\n\n```bash\n10 ms - 0\n11 ms - 1\n1004 ms - 2\n1012 ms - 3\n2008 ms - 4\n2013 ms - 5\n3010 ms - 6\n3014 ms - 7\n4017 ms - 8\n4017 ms - 9\n```\n\npre 1.x behavior\n-------------\n\nPrior to version 1.x.x, this module behaved as a throttle module. `function` would be invoked only one time per `limitCount/limitInterval` with no bursting. If you need this functionality again and do not want bursting, see the `lodash.throttle` module.\n\nLicense\n----------\n\n### The MIT License (MIT)\n\n\nCopyright (c) 2012 Daniel L. VerWeire\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[npm-image]: https://img.shields.io/npm/v/function-rate-limit.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/function-rate-limit\n[travis-image]: https://travis-ci.org/wankdanker/node-function-rate-limit.svg?style=flat-square\n[travis-url]: https://travis-ci.org/wankdanker/node-function-rate-limit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwankdanker%2Fnode-function-rate-limit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwankdanker%2Fnode-function-rate-limit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwankdanker%2Fnode-function-rate-limit/lists"}