Async is a utility library with roughly seventy functions for map, reduce, filter, parallel, series, waterfall, and similar asynchronous patterns in Node.js and browsers.
Overview
Async supplies higher-level helpers around Node-style callbacks where the last argument is a single callback that receives an error first and is invoked once. It covers familiar functional iterators as well as orchestration primitives such as parallel, series, and waterfall, with quick examples showing map, filter, and parallel task lists.
The package installs through npm, yarn, or direct browser bundles in a dist folder, and can be required as the full module or as per-method imports. It targets ES2015 environments in modern Node and browsers, with guidance for older runtimes via transpilation. An ES module build is included for bundlers that pick up .mjs files.
Recent versions accept native async functions anywhere a callback-based worker is expected, using return values and promise rejections instead of passing a callback. Transpiled async functions can be wrapped with asyncify. Version 3.0 allows canceling a flow by passing false as the error argument to stop remaining work.
Documentation on the project site covers stack overflow pitfalls from synchronous iteratees, multiple callback mistakes, early-exit patterns in nested flows, and cautions against mutating arrays during iteration. Community issues are encouraged when a needed helper is missing.
Async aims to be a comprehensive catalog of common asynchronous control-flow patterns rather than a single-purpose promise library.
Key features
- About seventy async helper functions
- Map, reduce, filter, and each iterators
- Parallel, series, and waterfall flows
- Node callback and async-function support
- Per-method and full package imports
- Browser dist and CDN bundles
- Flow cancel via false error argument
- npm and yarn installation
Use cases
- Coordinating parallel IO callbacks
- Serializing dependent async steps
- Filtering filesystem paths asynchronously
- Waterfall pipelines with early exit
- Legacy Node callback refactors