Skip to content

About

Async's auto function made easy

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async with easy auto function

Easy auto function for async. Uses function and parameter names to determine dependencies.

var async = require('async');
require('./async');

async.easyAuto(
    function a(callback) {
        callback(null, 'a');
    },

    function b(callback) {
        callback(null, 'b');
    },

    function ab(a, b, callback) {
        callback(null, a + b);
    }, 

    function d(callback) {
        callback(null, 'd');
    },

    function e(a, b, ab, d, callback) {
        console.log(a, b, ab, d);
    }
);

The result of the above is 'a b ab d' being printed.

Caveats

This is a fun example of exploiting JS's dynamic nature. It is not recommended for production code.

About

Async's auto function made easy

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages