iterate over collections in sync & async


Iterate over collections in sync or async

var iterators = require("iterators")
    , map =
    , fs = require("fs")
    , readFile = fs.readFile

    "foo": "test/foo.js"
    , "bar": "test/bar.js"
}, readFile, function (err, files) {

There are a few minor issues with the iterators on Array.prototype and alternatives provided by underscore / async.

This library fixes the following nitpicks:

  • You can call an iterator on both an array and an object
  • every / some return the truthy / falsey value without coercing to a boolean
  • reduce / reduceRight accept a optional thisValue
  • provides asynchronous implementations of all iterators that use a callback<Error, Value> instead of returning the value

npm install composite

make test

  • Raynos