walk-filtered
A simple, performant file system walker to provided fine-grained control over directories and files to walk. Supports Node 0.10 and above.
Last updated a month ago by kmalakoff .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install walk-filtered 
SYNC missed versions from official npm registry.

walk-filtered

A simple, performant file system walker to provided fine-grained control over directories and files to walk. Supports Node 0.10 and above.

Note: This API is very robust for a variety of use cases as it passes the chokidar and readdirp test suites plus it does not accumulate results in memory.

Entries are of the format:

  • string: basename - file or directory name
  • string: path - realtive path from the directory to the file or directory
  • string: fullPath - full path to the file or directory
  • fs.Stats | fs.Dirent: stats - file, directory or symlink stats

Promise Filter Function

await walk(rootPath, async (entry) => { /* do something */ return true or false });

Callback Filter Function

walk(rootPath, function(entry, callback) { /* do something */ callback(null, true or false); }, {callbacks: true}, done);

Synchronous Filter Function

walk(rootPath, function(entry) { /* do something */ return true or false }, done);

Options:

  • number: depth - choose maximum depth of the tree to traverse. (default: Infinity)
  • function: filter - filter function to continue processing the tree. Return false to skip processing (default: process all)
  • bool: callbacks - use a filter function with a callback format like function(entry, callback). (default: false)
  • bool: alwaysStat - stat each file individually rather than fetching dirents when reading directories. (default: false)
  • bool: lstat - use lstat to get the link's stats instead of using stat on the file itself. (default: false)
  • function: error - custom error callback for expected filesystem errors ('ENOENT', 'EPERM', 'EACCES', 'ELOOP'). Return false to stop processing. (default: silent filsystem errors)

Current Tags

  • 2.5.1                                ...           latest (a month ago)

48 Versions

  • 2.5.1                                ...           a month ago
  • 2.5.0                                ...           3 months ago
  • 2.4.4                                ...           3 months ago
  • 2.4.3                                ...           3 months ago
  • 2.4.2                                ...           4 months ago
  • 2.4.1                                ...           4 months ago
  • 2.4.0                                ...           4 months ago
  • 2.3.0                                ...           4 months ago
  • 2.2.0                                ...           4 months ago
  • 2.1.0                                ...           4 months ago
  • 1.24.0                                ...           4 months ago
  • 2.0.0                                ...           4 months ago
  • 1.23.0                                ...           4 months ago
  • 1.22.0                                ...           4 months ago
  • 1.21.0                                ...           4 months ago
  • 1.20.0                                ...           4 months ago
  • 1.19.0                                ...           4 months ago
  • 1.18.0                                ...           4 months ago
  • 1.17.0                                ...           4 months ago
  • 1.16.0                                ...           4 months ago
  • 1.15.0                                ...           a year ago
  • 1.14.0                                ...           a year ago
  • 1.13.0                                ...           a year ago
  • 1.12.0                                ...           a year ago
  • 1.11.0                                ...           a year ago
  • 1.10.0                                ...           a year ago
  • 1.9.0                                ...           a year ago
  • 1.8.0                                ...           a year ago
  • 1.7.0                                ...           a year ago
  • 1.6.0                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.9.3                                ...           5 years ago
  • 0.9.2                                ...           5 years ago
  • 0.9.1                                ...           5 years ago
  • 0.9.0                                ...           5 years ago
  • 0.8.0                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 27
Last Month 62
Dependencies (2)
Dev Dependencies (15)

Copyright 2014 - 2017 © taobao.org |