JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q48425F
  • License MIT

Better async utilities for node and the browser

Package Exports

  • async2

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (async2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Async2.js

Better asynchronous javascript flow control in 98 lines or 2.59KB minified (990 bytes gzipped).

Inspired by async, mini-async, Mocha, Chai, Should.js, and IcedCoffeeScript/TameJs libraries.

Flow Control

Quick Examples

First, reflect upon our haiku mantra:

"thoughtful single-chain

order of operations

escape callback hell!"

Then, observe in action:

async('pretend/path/to/file') # accepts initial input passed via waterfall to serial
  .serial(fs.readFile) # block until data is read
  .parallel [ tweet, fbook, gplus ], # push data to 3 services simultaneously
    (err, data) -> # execute once all above is complete
      #done()

For the latest examples, review the easy-to-follow ./test/test.coffee.

Or try it immediately in your browser with codepen.

TODO

  • potential node.js madness: each series becomes its own cpu thread, each parallel becomes its own gpu thread.

"GPUs have evolved to the point where many real-world applications are easily implemented on them and run significantly faster than on multi-core systems. Future computing architectures will be hybrid systems with parallel-core GPUs working in tandem with multi-core CPUs.' -- Professor Jack Dongarra, Director of the Innovative Computing Laboratory, The University of Tennessee