File system fs with array operation and Promise support.
$ npm install @write-for-christ/fs-array
constfsArray=require('@write-for-christ/fs-array');// Promise wayfsArray.readFiles(['/path/to/file1.json','/path/to/file2.json'],'utf8').then(contents=>{console.log(contents.length);//=> 2}).catch(err=>console.error(err));// Callback wayfsArray.readFiles(['/path/to/file1.json','/path/to/file2.json'],'utf8',(err,contents)=>{if(err){console.error(err);}else{console.log(contents.length);//=> 2}}// List filefsArray.readFiles('path/to/directory','.json').then(fileList=>{console.log(fileList);});Type: Array<string>
List of absolute files path to read.
Type: string
Encoding when read each file.
Type: Function
Callback take first param as error, the second is contents
MIT © Write For Christ