dat-readdir-stream
dat-readdir-stream
is a small util to read the file-table of a dat
as a stream, rather than through dat.readdir
.
npm i dat-readdir-stream --save
Usage
archive opts
archive
Hyperdrive archive (object).opts.glob
Do a glob match over a folder (string).opts.globOpts
Options passed to Minimatch (object).opts.cwd
Target directory path (string), defaults to/
.opts.recursive
Read all subfolders and their files as well?opts.maxDepth
Limit the depth until which to look into folders.opts.depthFirst
Using a depth-first search instead of the default breadth-first search.- Returns a readable stream in
Object Mode
. The payload per entry is an object:entry.location
The path of the entryentry.stats
A Stats object for that path
const ReaddirStream = var stream = archive cwd: '/assets' stream var stream = archive recursive: true stream var stream = archive recursive: true depthFirst: true stream
License
MIT