Gathering detailed insights and metrics for p-filter
Gathering detailed insights and metrics for p-filter
Gathering detailed insights and metrics for p-filter
Gathering detailed insights and metrics for p-filter
p-iteration
Make array iteration easy when using async/await and Promises
@cjsa/p-filter
Filter promises concurrently
hexo-filter-markdown-auto-indent
this is hexo markdown post filter,and it can auto to add indent style to p tag.
ngx-search-filter
<p align="center"> <img width="15%" height="15%" src="https://raw.githubusercontent.com/dkreider/ngx-search-filter/main/logo.png"> </p> <br />
npm install p-filter
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.6
Supply Chain
99.4
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (66.45%)
TypeScript (33.55%)
Total Downloads
896,384,241
Last Day
295,543
Last Week
5,117,827
Last Month
22,090,021
Last Year
222,303,642
MIT License
76 Stars
22 Commits
8 Forks
6 Watchers
1 Branches
5 Contributors
Updated on Mar 04, 2025
Minified
Minified + Gzipped
Latest Version
4.1.0
Package Id
p-filter@4.1.0
Unpacked Size
7.98 kB
Size
2.61 kB
File Count
5
NPM Version
9.2.0
Node Version
21.2.0
Published on
Dec 27, 2023
Cumulative downloads
Total Downloads
Last Day
-21.8%
295,543
Compared to previous day
Last Week
-10.1%
5,117,827
Compared to previous week
Last Month
8.1%
22,090,021
Compared to previous month
Last Year
6.1%
222,303,642
Compared to previous year
Filter promises concurrently
Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently and get a filtered down result.
1npm install p-filter
1import pFilter from 'p-filter'; 2import getWeather from 'get-weather'; // Not a real module 3 4const places = [ 5 getCapital('Norway').then(info => info.name), 6 'Bangkok, Thailand', 7 'Berlin, Germany', 8 'Tokyo, Japan', 9]; 10 11const filterer = async place => { 12 const weather = await getWeather(place); 13 return weather.temperature > 30; 14}; 15 16const result = await pFilter(places, filterer); 17 18console.log(result); 19//=> ['Bangkok, Thailand']
Returns a Promise
that is fulfilled when all promises in input
and ones returned from filterer
are fulfilled, or rejects if any of the promises reject. The fulfilled value is an Array
of the fulfilled values returned from filterer
in input
order.
Type: Iterable<Promise<unknown> | unknown>
Iterated over concurrently in the filterer
function.
Type: Function
The filterer function that decides whether an element should be included into result. Expected to return boolean | Promise<boolean>
.
Type: object
See the p-map
options.
Type: number
Default: Infinity
Minimum: 1
The number of concurrently pending promises returned by filterer
.
Returns an async iterable that iterates over the promises in iterable
and ones returned from filterer
concurrently, calling filterer
for each element.
1import {pFilterIterable} from 'p-filter'; 2import getWeather from 'get-weather'; // Not a real module 3 4async function * getPlaces() { 5 const name = await getCapital('Norway'); 6 7 yield name; 8 yield 'Bangkok, Thailand'; 9 yield 'Berlin, Germany'; 10 yield 'Tokyo, Japan'; 11} 12 13const places = getPlaces(); 14 15const filterer = async place => { 16 const weather = await getWeather(place); 17 return weather.temperature > 30; 18}; 19 20for await (const element of pFilterIterable(places, filterer)) { 21 console.log(element); 22} 23//=> ['Bangkok, Thailand']
Type: Iterable<Promise<unknown> | unknown>
Iterated over concurrently in the filterer
function.
Type: Function
The filterer function that decides whether an element should be included into result. Expected to return boolean | Promise<boolean>
.
Type: object
See the p-map
options.
Type: number
Default: Infinity
Minimum: 1
The number of concurrently pending promises returned by filterer
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 6/22 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More