node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


Walk the file system

walk(dir, [options], iterator, callback);


  • dir: absolute directory
  • options: optional, properties: { recursive: [default is true] }
  • iterator: function(path, stats), where stats is an instance of fs.Stats
  • callback: function(err)

Return false from the iterator to stop walking.

var walk = require('walk-fs');
walk(__dirname, function(path, stats) {
  console.log(path, stats);
}, function(err) {

npm install walk-fs