walk-fs

Walk the file system

npm install walk-fs
1 downloads in the last day
4 downloads in the last week
19 downloads in the last month

Walk a directory

API

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

Parameters:

  • 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.

Example

var walk = require('walk-fs');

walk(__dirname, function(path, stats) {
  console.log(path, stats);

}, function(err) {
  assert(!err);
});

Install

npm install walk-fs

npm loves you