Skip to content

The filterAsync() creates a new array with all elements that pass the test implemented by the provided function asynchronously which means no thread blocking until everything is filtered. Helps you with filtering bigarrays

Notifications You must be signed in to change notification settings

d73b04b0e696b0945283defa3eee4538/filterAsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

filterAsync

The filterAsync() creates a new array with all elements that pass the test implemented by the provided function asynchronously which means no thread blocking until everything is filtered. Helps you with filtering bigarrays

Installation

Node.js

filterAsync is available on npm. To install it, type:

$ npm install @ganeshnaidu/filter_async

Usage

'use strict';

// Import Package
const filterAsync = require("@ganeshnaidu/filter_async");

const games = ["Chess", "Cricket", "Soccer", "Tennis"];
const test = (sport) => ["Chess", "Tennis", "Cricket"].includes(sport);

!async function(){
	console.log(await filterAsync(games, test));
	console.log(await filterAsync(games, test, {first: 2}));
	console.log(await filterAsync(games, test, {last: 2}));
}()

Run Example

git clone https://github.com/ganeshnaidu/filterAsync.git
cd filterAsync
npm install
node example 

Test

git clone https://github.com/ganeshnaidu/filterAsync.git
cd filterAsync
npm install
node test 

About

The filterAsync() creates a new array with all elements that pass the test implemented by the provided function asynchronously which means no thread blocking until everything is filtered. Helps you with filtering bigarrays

Resources

Stars

Watchers

Forks

Packages

No packages published