Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "queue-up", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Simple promise-based function queue", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -18,17 +18,22 @@ # queue-up [![Build Status](https://travis-ci.org/dsblv/queue-up.svg?branch=master)](https://travis-ci.org/dsblv/queue-up) | ||
```js | ||
const got = require('got'); | ||
const ghGot = require('gh-got'); | ||
const Queue = require('queue-up'); | ||
const queue = new Queue(500); | ||
// GitHub API allows us to make 5000 requests per hour: | ||
queue.up() | ||
.then(got('github.com')) | ||
.then(data => { | ||
console.log('data'); | ||
}); | ||
const queue = new Queue(60 * 60 * 1000 / 5000); | ||
queue.up() | ||
.then(() => { | ||
console.log('Next call – only after .5sec!'); | ||
}); | ||
[ | ||
'dsblv', | ||
'strikeentco', | ||
'sindresorhus', | ||
'octocat' | ||
].forEach(user => { | ||
queue.up() | ||
.then(ghGot('users/' + user, {token: 'koten'})) | ||
.then(data => { | ||
console.log(data.body.name + ' is in ' + data.body.location); | ||
}); | ||
}); | ||
``` | ||
@@ -41,3 +46,3 @@ | ||
#### innerval | ||
#### interval | ||
@@ -44,0 +49,0 @@ Type: `number` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3342
62