Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
higher order functions for iterating over files
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
.gitignore
.npmignore
License
Makefile
Readme.md
index.js
package.json
series.js

Readme.md

dir-each

higher order functions for iterating over files

Installation

With npm

$ npm install dir-each --save

then in your app:

var each = require('dir-each')
var series = require('dir-each/series')

API

both functions also come in variations which include symlinked files. To access them use fn.withSyms

each(dir:String, fn:Function)

iterate over each file in dir and apply fn. each fully understands the semantics of Results so you can pass them as arguments and return them from fn with the desired effect.

var files = 0
each(process.env.HOME, function(path){
  console.log(path)
  files++
}).read(function(){
  console.log('you own %d files', files)
})

series(dir:String, fn:Function)

as above but waits on results between iterations

Running the tests

$ npm install
$ make test
Something went wrong with that request. Please try again.