Comparing version 1.1.0 to 1.2.0
'use strict'; | ||
const pTry = require('p-try'); | ||
module.exports = concurrency => { | ||
@@ -22,3 +24,3 @@ if (concurrency < 1) { | ||
fn().then( | ||
pTry(() => fn()).then( | ||
val => { | ||
@@ -25,0 +27,0 @@ resolve(val); |
{ | ||
"name": "p-limit", | ||
"version": "1.1.0", | ||
"description": "Run multiple promise-returning & async functions with limited concurrency", | ||
"license": "MIT", | ||
"repository": "sindresorhus/p-limit", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"promise", | ||
"limit", | ||
"limited", | ||
"concurrency", | ||
"throttle", | ||
"throat", | ||
"rate", | ||
"batch", | ||
"ratelimit", | ||
"task", | ||
"queue", | ||
"async", | ||
"await", | ||
"promises", | ||
"bluebird" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"delay": "^1.3.1", | ||
"in-range": "^1.0.0", | ||
"random-int": "^1.0.0", | ||
"time-span": "^1.0.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
"name": "p-limit", | ||
"version": "1.2.0", | ||
"description": "Run multiple promise-returning & async functions with limited concurrency", | ||
"license": "MIT", | ||
"repository": "sindresorhus/p-limit", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"promise", | ||
"limit", | ||
"limited", | ||
"concurrency", | ||
"throttle", | ||
"throat", | ||
"rate", | ||
"batch", | ||
"ratelimit", | ||
"task", | ||
"queue", | ||
"async", | ||
"await", | ||
"promises", | ||
"bluebird" | ||
], | ||
"dependencies": { | ||
"p-try": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"delay": "^2.0.0", | ||
"in-range": "^1.0.0", | ||
"random-int": "^1.0.0", | ||
"time-span": "^2.0.0", | ||
"xo": "*" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) | ||
``` | ||
$ npm install --save p-limit | ||
$ npm install p-limit | ||
``` | ||
@@ -27,6 +27,7 @@ | ||
// only one promise is run at once | ||
Promise.all(input).then(result => { | ||
(async () => { | ||
// Only one promise is run at once | ||
const result = await Promise.all(input); | ||
console.log(result); | ||
}); | ||
})(); | ||
``` | ||
@@ -33,0 +34,0 @@ |
Sorry, the diff of this file is not supported yet
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
35
70
3971
1
+ Addedp-try@^1.0.0
+ Addedp-try@1.0.0(transitive)