Package detail

component-each

component86.6k0.2.6

Array / object / string iteration utility

readme

each

Array / object / string iteration utility.

Installation

$ component install component/each

API

each(array, fn[, ctx])

Iterate an array:

each([1,2,3], function(num, i){

})

Optionally pass a context object:

each([1,2,3], function(num, i){

}, this)

each(object, fn[, ctx])

Iterate an object's key / value pairs:

each(conf, function(key, val){

})

Iterate an array-ish object (has numeric .length):

each(collection, function(val, i){

})

each(string, fn[, ctx])

Iterate a string's characters:

each('hello', function(c, i){

})

License

MIT

changelog

0.2.5 / 2014-07-07

  • fix component/type require for node

0.2.4 / 2014-05-27

  • update "to-function" to v2.0.5

0.2.3 / 2014-03-04

  • cmp: set components versions. bump @0.2.3

0.2.2 / 2014-02-26

  • package: fix "browser" field
  • package: pinning dependencies

0.2.1 / 2014-02-19

  • package: use "component-type" module

0.2.0 / 2014-02-19

  • package: rename to "component-each"
  • index: remove try/catch require('type') logic
  • package: simplify "browser" field
  • add context argument to invoke iterator in

0.1.0 / 2013-09-15

  • add repository field to readme [ForbesLindsay]
  • use component/to-function [yields]
  • support browserify [juliangruber]
  • use git dependency for type