Async utilities.
npm install @stdlib/utils-async
Alternatively,
- To load the package in a website via a
script
tag without installation and bundlers, use the ES Module available on theesm
branch. - If you are using Deno, visit the
deno
branch. - For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the
umd
branch.
The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.
var ns = require( '@stdlib/utils-async' );
Namespace containing async utilities.
var o = ns;
// returns {...}
anyByRightAsync( collection, [options,] predicate, done )
: test whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.anyByAsync( collection, [options,] predicate, done )
: test whether at least one element in a collection passes a test implemented by a predicate function.bifurcateByAsync( collection, [options,] predicate, done )
: split values into two groups according to a predicate function.composeAsync( ...fcn )
: function composition.countByAsync( collection, [options,] indicator, done )
: group values according to an indicator function and return group counts.doUntilAsync( fcn, predicate, done[, thisArg ] )
: invoke a function until a test condition is true.doWhileAsync( fcn, predicate, done[, thisArg ] )
: invoke a function while a test condition is true.everyByRightAsync( collection, [options,] predicate, done )
: test whether all elements in a collection pass a test implemented by a predicate function, iterating from right to left.everyByAsync( collection, [options,] predicate, done )
: test whether all elements in a collection pass a test implemented by a predicate function.forEachRightAsync( collection, [options,] fcn, done )
: invoke a function once for each element in a collection, iterating from right to left.forEachAsync( collection, [options,] fcn, done )
: invoke a function once for each element in a collection.functionSequenceAsync( ...fcn )
: function sequence.groupByAsync( collection, [options,] indicator, done )
: group values according to an indicator function.ifelseAsync( predicate, x, y, done )
: if a predicate function returns a truthy value, returnx
; otherwise, returny
.ifthenAsync( predicate, x, y, done )
: if a predicate function returns a truthy value, invokex
; otherwise, invokey
.inmapRightAsync( collection, [options,] fcn, done )
: invoke a function for each element in a collection and update the collection in-place, iterating from right to left.inmapAsync( collection, [options,] fcn, done )
: invoke a function for each element in a collection and update the collection in-place.mapFunAsync( fcn, n, [options,] done )
: invoke a functionn
times and return an array of accumulated function return values.mapKeysAsync( obj, [options,] transform, done )
: map keys from one object to a new object having the same values.mapValuesAsync( obj, [options,] transform, done )
: map values from one object to a new object having the same keys.noneByRightAsync( collection, [options,] predicate, done )
: test whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.noneByAsync( collection, [options,] predicate, done )
: test whether all elements in a collection fail a test implemented by a predicate function.reduceRightAsync( collection, initial, [options,] reducer, done )
: apply a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.reduceAsync( collection, initial, [options,] reducer, done )
: apply a function against an accumulator and each element in a collection and return the accumulated result.waterfall( fcns, clbk[, thisArg] )
: execute functions in series, passing the results of one function as arguments to the next function.someByRightAsync( collection, n, [options,] predicate, done )
: test whether a collection contains at leastn
elements which pass a test implemented by a predicate function, iterating from right to left.someByAsync( collection, n, [options,] predicate, done )
: test whether a collection contains at leastn
elements which pass a test implemented by a predicate function.tabulateByAsync( collection, [options,] indicator, done )
: generate a frequency table according to an indicator function.trycatchAsync( x, y, done )
: if a function does not return an error, invoke a callback with the function result; otherwise, invoke a callback with a valuey
.trythenAsync( x, y, done )
: if a function does not return an error, invoke a callback with the function result; otherwise, invoke a second function.untilAsync( predicate, fcn, done[, thisArg ] )
: invoke a function until a test condition is true.whileAsync( predicate, fcn, done[, thisArg ] )
: invoke a function while a test condition is true.
var objectKeys = require( '@stdlib/utils-keys' );
var ns = require( '@stdlib/utils-async' );
console.log( objectKeys( ns ) );
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2023. The Stdlib Authors.