https://github.com/dresende/calminha
Function calling rate limiter
https://github.com/dresende/calminha
Last synced: 11 months ago
JSON representation
Function calling rate limiter
- Host: GitHub
- URL: https://github.com/dresende/calminha
- Owner: dresende
- License: mit
- Created: 2015-10-16T10:47:09.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-16T10:50:50.000Z (about 10 years ago)
- Last Synced: 2025-01-02T02:44:32.360Z (about 1 year ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Calminha
Calminha is a NodeJS module to queue calls to a function and enforce a minimum interval between calls. It is also a portuguese word for "take it easy".
### Instalation
```sh
npm install calminha
```
### Usage
```js
var calminha = require("calminha");
var proxy = calminha("check-auth", checkAuthentication, { interval: 500 });
// an example of calling the proxy, the prototype
// is exactly as the hypothetical checkAuthentication
proxy("username", "password", function (err) {
// ...
});
```