Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

fswalk

mcfedr440MIT1.2.0

The simplest possible directory walker

recusive, directory, walk

readme

fswalk

Build Status npm version

The simplest possible directory walker

API

walk(dir, walkCb, finishCb, limit)

Parameters

  • dir: absolute dir to walk
  • walkCb: function(file, stats[, callback]) The function to be called with each file. If a callback is given any errors will be propagated to finishCb and the walk will stop soon. walkCb is called in parallel for some files, so the walk will stop at the current folder. finishCb will not be called until all walkCb callbacks have been called.
  • finishCb: function(err) Called when there are no more files
  • limit: max depth, undefined means no limit

Example

var walk = require('fswalk');

walk(__dirname, function(path, stats) {
  console.log(path, stats);
}, function(err) {
  assert(!err);
});

Install

npm install fswalk