Asnyc map that actualy works. Parallel and Series
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
LICENSE
README.md
index.js
package.json

README.md

foreign

Asnyc map that actualy works. Parallel, series, cury

Usage

var foreign = require('foreign');

Parallel

var items = [1,2,3];

foreign.parallel(
    function(item, callback){
        somethingAsync(item, callback);
    },
    items,
    function(error, result){

    }
);

Series

var items = [1,2,3];

foreign.series(
    function(item, callback){
        somethingAsync(item, callback);
    },
    items,
    function(error, result){

    }
);

Multiple return values

var items = [1,2,3];

    foreign.series(
        function(item, callback){
            callback(null, item, 'foo');
        },
        items,
        function(error, results){
            console.log(results); // [[1, 'foo'], [2, 'foo'], [3, 'foo']]
        }
    );