dir-each

higher order function for iterating over files

dir-each

higher order functions for iterating over files

With npm

$ npm install dir-each --save

then in your app:

var each = require('dir-each')

iterate over each file in dir and apply fn

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