Skip to content

Commit 1e798c7

Browse files
committedDec 22, 2023
Require Node.js 18
1 parent 1d093e6 commit 1e798c7

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed
 

‎.github/funding.yml

-4
This file was deleted.

‎.github/workflows/main.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13-
- 16
13+
- 20
14+
- 18
1415
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v2
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
1718
with:
1819
node-version: ${{ matrix.node-version }}
1920
- run: npm install

‎index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ const filterer = async place => {
6767
return weather.temperature > 30;
6868
};
6969
70-
const result = await pFilterIterable(places, filterer);
71-
72-
console.log(result);
70+
for await (const element of pFilterIterable(places, filterer)) {
71+
console.log(element);
72+
}
7373
//=> ['Bangkok, Thailand']
7474
```
7575
*/

‎package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
"url": "https://sindresorhus.com"
1212
},
1313
"type": "module",
14-
"exports": "./index.js",
14+
"exports": {
15+
"types": "./index.d.ts",
16+
"default": "./index.js"
17+
},
18+
"sideEffects": false,
1519
"engines": {
16-
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
20+
"node": ">=18"
1721
},
1822
"scripts": {
1923
"test": "xo && ava && tsd"
@@ -34,8 +38,7 @@
3438
"promises",
3539
"concurrently",
3640
"concurrency",
37-
"parallel",
38-
"bluebird"
41+
"parallel"
3942
],
4043
"dependencies": {
4144
"p-map": "^7.0.0"

‎readme.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Useful when you need to run promise-returning & async functions multiple times w
66

77
## Install
88

9-
```
10-
$ npm install p-filter
9+
```sh
10+
npm install p-filter
1111
```
1212

1313
## Usage
@@ -42,7 +42,7 @@ Returns a `Promise` that is fulfilled when all promises in `input` and ones retu
4242

4343
#### input
4444

45-
Type: `Iterable<Promise|any>`
45+
Type: `Iterable<Promise<unknown> | unknown>`
4646

4747
Iterated over concurrently in the `filterer` function.
4848

@@ -70,7 +70,6 @@ The number of concurrently pending promises returned by `filterer`.
7070

7171
Returns an async iterable that iterates over the promises in `iterable` and ones returned from `filterer` concurrently, calling `filterer` for each element.
7272

73-
#### Usage
7473
```js
7574
import {pFilterIterable} from 'p-filter';
7675
import getWeather from 'get-weather'; // Not a real module
@@ -91,15 +90,15 @@ const filterer = async place => {
9190
return weather.temperature > 30;
9291
};
9392

94-
const result = await pFilterIterable(places, filterer);
95-
96-
console.log(result);
93+
for await (const element of pFilterIterable(places, filterer)) {
94+
console.log(element);
95+
}
9796
//=> ['Bangkok, Thailand']
9897
```
9998

10099
#### iterable
101100

102-
Type: `Iterable<Promise|any>`
101+
Type: `Iterable<Promise<unknown> | unknown>`
103102

104103
Iterated over concurrently in the `filterer` function.
105104

0 commit comments

Comments
 (0)
Please sign in to comment.