walk-promise

0.2.0 • Public • Published

☎ walk-promise


Recursively find files from a list of paths using promises and return them along with file information. This allows you to easily integrate walk functionality into a project that is already using promises

  • See the WIKI for full documentation
  • And the Change Log for what's new!

Documentation

walk(path, [options])

Walks one or more directories and returns information on the files in those directories

Parameters

  • path {string | string[]} - path or array of paths to start walk from
  • [options] {Object} - Options hash
    • [ignore] {string[]} - Paths to ignore

Returns {Promise} - Returns a Promise that resolves to an array of file information objects


Output

Output is in for form of an array of file info objects. File info objects are composed of the following

root - The full path to the file name - The file name stat - The file stat object for the file

Examples
var walk = require('walk-promise');
 
// single path
walk('/home/user/documents').then(function(files) {
    console.log(files);
});
 
// multiple paths
walk(['../lib', '/home/user/documents']).then(function(files) {
    console.log(files);
});
 
// multiple paths with ignore
walk(['../lib', '/home/user/documents'], {
    ignore: ['/home/user/documents/private']
})
.then(function(files) {
    console.log(files);
});
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    107
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    107
  • 0.1.0
    1

Package Sidebar

Install

npm i walk-promise

Weekly Downloads

61

Version

0.2.0

License

MIT

Last publish

Collaborators

  • vbranden