Package Exports
- files-from-path
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (files-from-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
files-from-path
Match provided glob paths to file objects with readable stream
Install
# install it as a dependency
$ npm i files-from-pathUsage
import filesFromPath from 'files-from-path'
for await (const f of filesFromPath(`path/to/somewhere`)) {
console.log(f)
// { name: '/path/to/me', stream: [Function: stream] }
}API
The following parameters can be provided to filesFromPath.
| Name | Type | Description |
|---|---|---|
| paths | `Iterable |
AsyncIterable |
| [options] | object |
options |
| [options.hidden] | boolean |
Include .dot files in matched paths |
| [options.ignore] | string[] |
Glob paths to ignore |
| [options.followSymlinks] | boolean |
follow symlinks |
| [options.preserveMode] | boolean |
preserve mode |
| [options.mode] | number |
mode to use - if preserveMode is true this will be ignored |
| [options.preserveMtime] | boolean |
preserve mtime |
It yields file like objects in the form of { name: String, stream: AsyncIterator<Buffer> }