Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Walk the file system with Node.js
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
index.js
package.json

README.md

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

Something went wrong with that request. Please try again.