Socket
Socket
Sign inDemoInstall

allo

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

allo

Async functions to deal with race conditions


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

Minor package with async helper functions.

I'm releasing this package for my own convenience since sometimes I have to work with code without promises/streams/events... and this is much smaller than any other library.

Feel free to use, but...

allo.series([
    // First call this function
    function (next) {
        // the function receives a `next` function as argument
        // call the `next` function to iterate to the next function
        next('a')
    },
    // Then call this function
    function (letter, next) {
        next(2)
    },
    function (letter, number, next) {
        // all previous functions called the `next` function meanining
        // they have completed their tasks.
        next()
    }
]);
// call all the given functions at the same time
allo.parallel([
    function (done) {
        done('a');
    },
    function (done) {
        done(2);
    },
    {
        fn: function (done) {
            done(['hello', 'world']);
        },
        // Call this function when the `fn:` function says it's done
        // the `cancel` argument is a function that will cancel the call to
        // all future callbacks
        cb: function (cancel, arr) {
            // do something with `arr
        }
    },
    function (done) {
        done({foo:'bar'})
    }
], function (letter, number, array, object) {

})

Don't forget to check the License

Keywords

FAQs

Package last updated on 23 Jun 2014

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