Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

read-files extends fs by the static method readFiles.

fs.readFiles(filenames[, encoding, batchCount], callback)

Asynchronously reads the entire contents of the files specified in filenames.

filenames is an array of filenames.

encoding is a string specifying the files' encodings. The default is "utf8".

batchCount is a number specifying the number of files to process at a time before moving to the next batch (default 100).

callback is a callback function that is passed two arguments (err, data) where data is an object of the form:

{filename1: file1contents,filename2: file2contents,}

Example:

varfs=require("fs");require("read-files");fs.readFiles(["file1","file2"],"utf8",function(err,data){if(err)throwerr;console.log(data);});

About

Asynchronously reads an array of files and returns their contents

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages