directory-tree-stream
A streaming directory traverser for node 4 or greater
Installation
npm install directory-tree-stream
Usage
The following example demonstrates how to use this module:
const dirTreeStream = const es = // Read tree with the directory of this script (__dirname) as root-directory // file.stat contains the fs.Stats object // file.path contains the path, relative to the root directory
This will generate the following output
16893
16893 subdir
33204 subdir/file.txt
33204 example.js
API-reference
directoryTreeStream(root)
Creates an instance of stream.Readable that emits all files and directories of a given directory tree (recursively)
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
root | string |
the root directory |
License
directory-tree-stream
is published under the MIT-license.
See LICENSE.md for details.
Release-Notes
For release notes, see CHANGELOG.md
Contributing guidelines
See CONTRIBUTING.md.