Class

FSAsyncIterable

FSAsyncIterable()

This is util class not inteded to use directly, It used for iterate through dirents.
Constructor

# new FSAsyncIterable()

View Source fs-async-iterable.class.ts, line 5

Classes

FSAsyncIterable

Methods

# filter(callback, parallel)

Pass items only when callback returns true.
Parameters:
Name Type Default Description
callback async function (must return Promise).
parallel 1 number of callbacks runs in parallel

View Source fs-async-iterable.class.ts, line 57

# async forEach(callback, parallel)

The forEach() method executes a provided function once for each array element
Parameters:
Name Type Default Description
callback async function (must return Promise).
parallel 1 max items, that can be processed at same time. Optional parameter, equals 1 by default

View Source fs-async-iterable.class.ts, line 116

# map(callback, parallel)

Transform input items
Parameters:
Name Type Default Description
callback async function (must return Promise), which transform input item to output item
parallel 1 number of callbacks runs in parallel

View Source fs-async-iterable.class.ts, line 18

# async reduce(callback, initialValue)

Calls the specified callback function for all the input elements. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Parameters:
Name Type Description
callback A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. Must return promise or be async.
initialValue initialValue is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument.

View Source fs-async-iterable.class.ts, line 104

# async toArray()

The toArray() method collect itertor items to array.

View Source fs-async-iterable.class.ts, line 136