Skip to documentation

package

@stackline/async 1.0.5 — installation and API

Higher-order functions and common patterns for asynchronous code

Install @stackline/async

npm install @stackline/[email protected]

Package version: 1.0.5. Metadata verified: 2026-11-12. This is separate from the framework version and demonstration runtime.

Node.js requirement
{}
Accepted peer dependencies (declared ranges)
{}

Tested environments are described in the versioned README and linked source checks. A declared peer range is not evidence that every version in it was tested.

Versioned reference

This reference comes from the published @stackline/[email protected] README. Its upstream attribution and license remain with the source. Benchmark and security statements describe the cited tests and advisories, not a guarantee for every application.

@stackline/async

Higher-order functions and common patterns for asynchronous code.

Documentation | npm | Issues | Repository

Current package version: 1.0.5


Why this package?

@stackline/async is the Stackline-maintained distribution of [email protected]. It is an independent continuation of async; original authors and licenses remain credited below.

Compatibility

Item Value
Package @stackline/[email protected]
API target [email protected]
Supported Node.js See supported framework requirements
License MIT
Main entry dist/async.js
Module entry dist/async.mjs
Runtime dependencies none

Installation

npm install @stackline/async

Preserve existing imports and plugin resolution with an npm alias:

npm install async@npm:@stackline/async

Usage and API reference

Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally designed for use with Node.js and installable via npm i @stackline/async, it can also be used directly in the browser. An ESM/MJS version is included in the main async package that should automatically be used with compatible bundlers such as Webpack and Rollup.

A pure ESM version of Async is available as async-es.

For Documentation, visit https://caolan.github.io/async/

For Async v1.5.x documentation, go HERE

// for use with Node-style callbacks...
var async = require("@stackline/async");

var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
var configs = {};

async.forEachOf(obj, (value, key, callback) => {
    fs.readFile(__dirname + value, "utf8", (err, data) => {
        if (err) return callback(err);
        try {
            configs[key] = JSON.parse(data);
        } catch (e) {
            return callback(e);
        }
        callback();
    });
}, err => {
    if (err) console.error(err.message);
    // configs is now a map of JSON data
    doSomethingWith(configs);
});
var async = require("@stackline/async");

// ...or ES2017 async functions
async.mapLimit(urls, 5, async function(url) {
    const response = await fetch(url)
    return response.body
}, (err, results) => {
    if (err) throw err
    // results is now an array of the response bodies
    console.log(results)
})

Credits and original authors

Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.

License

MIT. See the license and notice files in the repository.

Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.

Upstream documentation

The original upstream README is preserved in UPSTREAM_README.md.

Examples and compatibility

The original example runtime is preserved. Its build is identified by source commit 25d2c5d70068c5e2240147db33d95f49454616ad. Package version and runtime version must be checked independently.

Open the original example

Examples load only when requested. They have their own runtime and are separate from this reference.