recurse
Takes a root dir and recursively streams paths.
Example
var recurse = ; // recursively write all filetypes except directories:; // recursively write js files: { return !stat && relname}; // recursively write dirs: { return stat;}; // non-recursively write all files: { return false;}; // recurse into test/ and write js files: { return stat && ~relname;};
Mehods
var recurse = ;
var s = recurse(root, opts={})
Return a redable stream of all paths beneath a root
directory.
Optionally pass in the following opts
:
opts.writefilter
- custom function for determining whether to write a path to the recurse stream using aopts.writefilter(relname, stat)
signature.opts.recursefilter
- custom function for determining whether to recurse a path using aopts.writefilter(relname, stat)
signature.opts.resolvesymlinks
- if set to true symbolic links will be resolved
Compatibility
Node 0.8.x will use the readable-stream
module while node 0.10.x and newer
will use the core Readable
stream class.
Performance
recurse
is about an order of magnitude slower than GNU find
after a couple of runs on my home directory. See the benchmark
for detailed results against other node modules.
License
MIT