1.1.0 • Published 2 years ago
rate-limiter-promise v1.1.0
rate-limiter-promise
A simple library to wrap methods with rate limiting.
Instalation
To install simply run:
$ npm install rate-limiter-promise
Or, if you use yarn:
$ yarn add rate-limiter-promise
Example usage
const limiter = require('rate-limiter-promise');
const fn = a => a*a;
const limitedFn = limiter(fn).to(1).per(1000);
const a = await limitedFn(2);
Test
To test, simply run:
$ npm test
You can also check for linting errors:
$ npm run lint
License
Unlicense