Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/titarenko/speed-limit
Limit promised function calls in your node.js app
https://github.com/titarenko/speed-limit
Last synced: about 2 months ago
JSON representation
Limit promised function calls in your node.js app
- Host: GitHub
- URL: https://github.com/titarenko/speed-limit
- Owner: titarenko
- Created: 2015-11-21T15:28:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-21T16:26:50.000Z (about 9 years ago)
- Last Synced: 2024-11-30T21:42:34.999Z (about 2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# speed-limit
## Installation
```bash
npm i speed-limit
```## Example
```js
var limit = require('speed-limit');// note: it returns promise
function myFunc () {
return db('orders').whereNotNull('price');
}// limit call rate to 1 call per 1 sec with jitter ±200 msec
var myFuncLimited = limit(myFunc, { limit: 1, per: 1000, jitter: 200 });
```## License
MIT