New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

modern-async

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modern-async

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

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
decreased by-34.38%
Maintainers
1
Weekly downloads
 
Created
Source

modern-async

GitHub Repo stars Website Node.js CI npm

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

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 and promises in its code, tests and documentation.
  • Has almost no dependencies.
  • Has 100% code coverage.
  • Bundled for ESM modules, CommonJS and UMD.
  • Works in node >= 10.0 and in the vast majority of browsers (old browser compatibility can be achieved using Babel and shims).

This project accepts feature requests !

The goal of modern-async is to be as complete as possible. I coded everything I missed in the past while developing, yet it's difficult to know what other people would really need. So if you would like some more feature start by reading the contribution guide.

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 { map, asyncRoot, sleep } from 'modern-async'

// or

const { map, asyncRoot, sleep } = require('modern-async')

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

See the documentation for the rest.

Changelog

See the changelog.

License

See the license here.

Keywords

FAQs

Package last updated on 15 Dec 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc