# node-filter-async

> Filter array elements with Promises

Latest version **3.0.0** (published 2021-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-filter-async
pnpm add node-filter-async
yarn add node-filter-async
bun add node-filter-async
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-10-14 |
| First published | 2017-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.0.0 |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Mgenware |
| Maintainers | mgenware |
| Keywords | array, filter |

## Links

- npm: https://www.npmjs.com/package/node-filter-async
- Repository: https://github.com/mgenware/node-filter-async
- Issues: https://github.com/mgenware/node-filter-async/issues
- npm.io page: https://npm.io/package/node-filter-async

## Recent versions

- 3.0.0 (latest) — 2021-10-14
- 2.0.0 — 2020-02-17
- 1.1.4 — 2019-12-21
- 1.1.3 — 2019-06-14
- 1.1.2 — 2019-04-04
- 1.1.1 — 2018-12-25
- 1.0.1 — 2018-10-25
- 1.0.0 — 2018-08-13
- 0.0.4 — 2017-10-20
- 0.0.3 — 2017-10-13
- 0.0.2 — 2017-10-13
- 0.0.1 — 2017-10-13

## README

# node-filter-async

[![Build Status](https://github.com/mgenware/node-filter-async/workflows/Build/badge.svg)](https://github.com/mgenware/node-filter-async/actions)
[![npm version](https://img.shields.io/npm/v/node-filter-async.svg?style=flat-square)](https://npmjs.com/package/node-filter-async)
[![Node.js Version](http://img.shields.io/node/v/node-filter-async.svg?style=flat-square)](https://nodejs.org/en/)

Filter array elements with Promises, zero dependencies, written in TypeScript.

### Installation

```bash
npm i node-filter-async
```

## Usage

### API

```javascript
filterAsync<T>(
  // The array to be filtered.
  array: T[],
  // The async filter callback.
  callback: (value: T, index: number) => Promise<boolean>,
): Promise<T[]>;
```

Example:

```js
import filterAsync from 'node-filter-async';

(async () => {
  const results = await filterAsync(someArray, async (value, index) => {
    console.log(`filtering [${index}]: ${value}`);
    return (await asyncFunc(value)) === 'blablabla';
  });
})();
```

---
_Source: https://npm.io/package/node-filter-async · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
