Skip to content

adrienleroy/node-async-filter

Repository files navigation

node-async-filter

Filter array in an async way written in TypeScript.

Installation

npm i node-async-filter

Usage

API

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

Example:

import { asyncFilter } from "node-async-filter ";

(async () => {
  const results = await asyncFilter(someArray, async (value, index) => {
    return (await asyncFunc(value)) === 'myCheckingValue';
  });
})();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published