diff options
Diffstat (limited to 'node_modules/p-limit')
-rw-r--r-- | node_modules/p-limit/index.js | 4 | ||||
-rw-r--r-- | node_modules/p-limit/license | 20 | ||||
-rw-r--r-- | node_modules/p-limit/package.json | 94 | ||||
-rw-r--r-- | node_modules/p-limit/readme.md | 9 |
4 files changed, 59 insertions, 68 deletions
diff --git a/node_modules/p-limit/index.js b/node_modules/p-limit/index.js index bfafd2688..873f0e70d 100644 --- a/node_modules/p-limit/index.js +++ b/node_modules/p-limit/index.js @@ -1,4 +1,6 @@ 'use strict'; +const pTry = require('p-try'); + module.exports = concurrency => { if (concurrency < 1) { throw new TypeError('Expected `concurrency` to be a number from 1 and up'); @@ -19,7 +21,7 @@ module.exports = concurrency => { const run = () => { activeCount++; - fn().then( + pTry(fn).then( val => { resolve(val); next(); diff --git a/node_modules/p-limit/license b/node_modules/p-limit/license index 654d0bfe9..e7af2f771 100644 --- a/node_modules/p-limit/license +++ b/node_modules/p-limit/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-limit/package.json b/node_modules/p-limit/package.json index 697bfcd48..4079517f1 100644 --- a/node_modules/p-limit/package.json +++ b/node_modules/p-limit/package.json @@ -1,49 +1,49 @@ { - "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.3.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": "*" + } } diff --git a/node_modules/p-limit/readme.md b/node_modules/p-limit/readme.md index c7a10deb6..90129925c 100644 --- a/node_modules/p-limit/readme.md +++ b/node_modules/p-limit/readme.md @@ -6,7 +6,7 @@ ## Install ``` -$ npm install --save p-limit +$ npm install p-limit ``` @@ -23,10 +23,11 @@ const input = [ limit(() => doSomething()) ]; -// 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); -}); +})(); ``` |