Skip to content

mcfedr/fswalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fswalk

The simplest possible directory walker

Build Status npm version

Installation

npm install fswalk

Example

var walk = require('fswalk');

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

API

walk(dir, walkCb, finishCb, limit)

Parameters
  • dir: The directory to walk

  • walkCb: function(file, stats[, callback]) The function to be called with each file.

    • file: Relative file path
    • callback: If 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 all files have been walked.

  • limit: Max depth, undefined means no limit

About

The simplest possible directory walker

Resources

License

Stars

Watchers

Forks

Packages

No packages published