Skip to content

Commit 38cda2b

Browse files
committed
Require Node.js 10
1 parent e0c1389 commit 38cda2b

File tree

8 files changed

+42
-55
lines changed

8 files changed

+42
-55
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: node_js
22
node_js:
3+
- '12'
34
- '10'
4-
- '8'
5-
- '6'

index.d.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ declare namespace pAll {
44
type PromiseFactory<T> = () => PromiseLike<T>;
55
}
66

7+
// TODO: Refactor the whole definition back to multiple overloaded functions
78
/**
89
Run promise-returning & async functions concurrently with optional limited concurrency.
910
@@ -54,18 +55,18 @@ declare const pAll: {
5455
],
5556
options?: pAll.Options
5657
): Promise<
57-
[
58-
Result1,
59-
Result2,
60-
Result3,
61-
Result4,
62-
Result5,
63-
Result6,
64-
Result7,
65-
Result8,
66-
Result9,
67-
Result10
68-
]
58+
[
59+
Result1,
60+
Result2,
61+
Result3,
62+
Result4,
63+
Result5,
64+
Result6,
65+
Result7,
66+
Result8,
67+
Result9,
68+
Result10
69+
]
6970
>;
7071
<
7172
Result1,
@@ -91,17 +92,17 @@ declare const pAll: {
9192
],
9293
options?: pAll.Options
9394
): Promise<
94-
[
95-
Result1,
96-
Result2,
97-
Result3,
98-
Result4,
99-
Result5,
100-
Result6,
101-
Result7,
102-
Result8,
103-
Result9
104-
]
95+
[
96+
Result1,
97+
Result2,
98+
Result3,
99+
Result4,
100+
Result5,
101+
Result6,
102+
Result7,
103+
Result8,
104+
Result9
105+
]
105106
>;
106107
<Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8>(
107108
tasks: [
@@ -116,7 +117,7 @@ declare const pAll: {
116117
],
117118
options?: pAll.Options
118119
): Promise<
119-
[Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8]
120+
[Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8]
120121
>;
121122
<Result1, Result2, Result3, Result4, Result5, Result6, Result7>(
122123
tasks: [
@@ -177,12 +178,9 @@ declare const pAll: {
177178
options?: pAll.Options
178179
): Promise<[Result1]>;
179180
<TAll>(
180-
tasks: Iterable<pAll.PromiseFactory<TAll>> | pAll.PromiseFactory<TAll>[],
181+
tasks: Iterable<pAll.PromiseFactory<TAll>> | Array<pAll.PromiseFactory<TAll>>,
181182
options?: pAll.Options
182183
): Promise<TAll[]>;
183-
184-
// TODO: Remove this for the next major release, refactor the whole definition back to multiple overloaded functions
185-
default: typeof pAll;
186184
};
187185

188186
export = pAll;

index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
const pMap = require('p-map');
33

44
module.exports = (iterable, options) => pMap(iterable, element => element(), options);
5-
// TODO: Remove this for the next major release
6-
module.exports.default = module.exports;

index.test-d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ const actions: [
77
() => Promise<void>,
88
() => Promise<number>
99
] = [
10-
() => Promise.resolve('https://sindresorhus.com'),
11-
() => Promise.resolve('https://ava.li'),
12-
() => Promise.resolve(),
13-
() => Promise.resolve(1)
10+
async () => Promise.resolve('https://sindresorhus.com'),
11+
async () => Promise.resolve('https://ava.li'),
12+
async () => Promise.resolve(),
13+
async () => Promise.resolve(1)
1414
];
1515

1616
const result = await pAll(actions, {concurrency: 2});

license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
3+
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
44

55
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:
66

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"description": "Run promise-returning & async functions concurrently with optional limited concurrency",
55
"license": "MIT",
66
"repository": "sindresorhus/p-all",
7+
"funding": "https://github.com/sponsors/sindresorhus",
78
"author": {
89
"name": "Sindre Sorhus",
910
"email": "[email protected]",
10-
"url": "sindresorhus.com"
11+
"url": "https://sindresorhus.com"
1112
},
1213
"engines": {
13-
"node": ">=6"
14+
"node": ">=10"
1415
},
1516
"scripts": {
1617
"test": "xo && ava && tsd"
@@ -48,7 +49,7 @@
4849
"devDependencies": {
4950
"ava": "^1.4.1",
5051
"delay": "^4.1.0",
51-
"tsd": "^0.7.2",
52-
"xo": "^0.24.0"
52+
"tsd": "^0.11.0",
53+
"xo": "^0.28.0"
5354
}
5455
}

readme.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ If you're doing the same work in each function, use [`p-map`](https://github.com
88

99
See [`p-series`](https://github.com/sindresorhus/p-series) for a serial counterpart.
1010

11-
1211
## Install
1312

1413
```
1514
$ npm install p-all
1615
```
1716

18-
1917
## Usage
2018

2119
```js
@@ -34,10 +32,9 @@ const got = require('got');
3432
})();
3533
```
3634

37-
3835
## API
3936

40-
### pAll(tasks, [options])
37+
### pAll(tasks, options?)
4138

4239
Returns a `Promise` that is fulfilled when all promises returned from calling the functions in `tasks` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values in `tasks` order.
4340

@@ -49,12 +46,12 @@ Iterable with promise-returning/async functions.
4946

5047
#### options
5148

52-
Type: `Object`
49+
Type: `object`
5350

5451
##### concurrency
5552

56-
Type: `number`<br>
57-
Default: `Infinity`<br>
53+
Type: `number`\
54+
Default: `Infinity`\
5855
Minimum: `1`
5956

6057
Number of concurrent pending promises.
@@ -66,7 +63,6 @@ Default: `true`
6663

6764
When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises.
6865

69-
7066
## Related
7167

7268
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
@@ -75,8 +71,3 @@ When set to `false`, instead of stopping when a promise rejects, it will wait fo
7571
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
7672
- [p-limit](https://github.com/sindresorhus/p-limit) - Run multiple promise-returning & async functions with limited concurrency
7773
- [More…](https://github.com/sindresorhus/promise-fun)
78-
79-
80-
## License
81-
82-
MIT © [Sindre Sorhus](https://sindresorhus.com)

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'ava';
22
import delay from 'delay';
33
import pAll from '.';
44

5-
// See `p-map` for more comprehensive tests
5+
// See `p-map` for more comprehensive tests.
66
test('main', async t => {
77
const input = [
88
async () => 1,

0 commit comments

Comments
 (0)