Socket
Socket
Sign inDemoInstall

modern-async

Package Overview
Dependencies
2
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    modern-async

A modern tooling library for asynchronous operations using async/await, promises and async generators


Version published
Weekly downloads
15K
decreased by-2.51%
Maintainers
1
Install size
1.41 MB
Created
Weekly downloads
 

Changelog

Source

2.0.0

  • Major re-design of the API. This re-design was made with the following goals:

    • Avoiding function naming conflict with popular libraries (notably lodash)
    • Simplifying the API by removing duplicate functions
    • Proposing safer default parameters regarding concurrency handling

    See the migration guide to know how to migrate to version 2.X.

  • Added reflectAsyncStatus() function.

Readme

Source

modern-async Tweet

logo

GitHub Repo stars Website Node.js CI npm Coverage Status

A modern JavaScript tooling library for asynchronous operations using async/await, promises and async generators.

This library is a modernized alternative to a lot of libraries like Async.js that were created using the legacy callback style to handle asynchronous operations. Its goal is to be as complete as any of those libraries while being built from the very beginning with async/await and promises in mind.

See the documentation.

  • Exclusively uses async/await, promises and async generators in its code, tests and documentation.
  • Has low bundle size.
  • Has 100% code coverage.
  • Bundled for ESM modules, CommonJS and UMD.
  • Works in node >= 8 and in the vast majority of browsers (very old browser compatibility can be achieved using Babel and shims).
  • Has Typescript support.

Stargazers repo roster for @nicolas-van/modern-async

Installation

npm install --save modern-async

Or use jsDelivr to get the UMD version. The content of the library will be available under the modernAsync global variable.

Usage

import { asyncMap, asyncSleep } from 'modern-async'

const array = [1, 2, 3]
const result = await asyncMap(array, async (v) => {
  await asyncSleep(10)
  return v * 2
})
console.log(result)

See the documentation for the rest.

Migrating from version 1.X to version 2.X

See the migration guide.

Changelog

The changelog.

Contribution Guide

The contribution guide

License

The license.

Keywords

FAQs

Last updated on 29 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc