Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbkaplun/rate-limit-promise
Return a promise that is resolved as more requests can be made
https://github.com/dbkaplun/rate-limit-promise
Last synced: 28 days ago
JSON representation
Return a promise that is resolved as more requests can be made
- Host: GitHub
- URL: https://github.com/dbkaplun/rate-limit-promise
- Owner: dbkaplun
- License: mit
- Created: 2016-03-17T01:24:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-31T01:18:07.000Z (about 8 years ago)
- Last Synced: 2024-04-14T10:47:42.174Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rate-limit-promise [![Build Status](https://travis-ci.org/dbkaplun/rate-limit-promise.svg?branch=master)](https://travis-ci.org/dbkaplun/rate-limit-promise)
Return a promise that is resolved as more requests can be made## Installation
```sh
$ npm install rate-limit-promise
```## Usage
```js
const rateLimit = require('rate-limit-promise')let request = rateLimit(1, 1000) // 1 request per 1000ms = 1 second
Promise.all([request(), request(), request()]).then(() => {
console.log("2 seconds have passed")
})
```