read-multiple-files
Read multiple files Observable way
const readMultipleFiles = ; ;
Installation
npm install read-multiple-files
API
const readMultipleFiles = ;
readMultipleFiles(paths [, options])
paths: <Array|Set<string|Buffer|URL|integer>>
(file paths)
options: Object
(fs.readFile
options) or string
(encoding)
Return: Observable
(Kevin Smith's implementation)
When the Observable
is subscribed, it starts to read files in parallel, successively send each result to its Observer
as an Object
: {path: <string|Buffer|URL|integer>, contents: <string:Buffer>}
;
The Observer
receives an error when it fails to read at least one of the files.
const readMultipleFiles = ; ;
Related project
- read-files-promise —
Promise
interface version
License
ISC License © 2017 - 2018 Shinnosuke Watanabe