Socket
Socket
Sign inDemoInstall

iterators

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iterators

iterate over collections in sync & async


Version published
Weekly downloads
2.2K
increased by8.97%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 15 Nov 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc