Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
iterate over collections asynchronously
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
test
.gitignore
.travis.yml
LICENCE
Makefile
README.md
index.js
package.json
testem.json

README.md

Iterators build status

Iterate over collections in sync or async

Example

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

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

Motivation

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 instead of returning the value

Installation

npm install iterators

Tests

make test

Contributors

  • Raynos

MIT Licenced

Something went wrong with that request. Please try again.