iterators
iterate over collections in sync & async
Last updated 12 years ago .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install iterators 
SYNC missed versions from official npm registry.

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

Installation

npm install composite

Tests

make test

Contributors

  • Raynos

MIT Licenced

Current Tags

  • 0.3.3                                ...           latest (12 years ago)

7 Versions

  • 0.3.3                                ...           12 years ago
  • 0.3.2                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.3.1                                ...           12 years ago
  • 0.3.0                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
  • ap ~0.1.0
Dev Dependencies (4)
  • testling git://github.com/Raynos/testling#implement-render
  • testem git://github.com/Raynos/testem#master
  • sinon git://github.com/Raynos/Sinon.JS.git
  • tap 0.2.5

Copyright 2013 - present © cnpmjs.org | Home |