Synchronously read files from a directory.
npm i @cloudcmd/read-files-sync
path
string - path to a directorymode
string - mode
const readFilesSync = require('@cloudcmd/read-files-sync');
readFilesSync('./fixture', 'utf8');
// returns
{
a: 'hello',
b: 'world',
}
path
string - path to a directorynames
array - file names to readmode
string - mode
readFilesSync('./fixture', ['a'], 'utf8');
// returns
{
a: 'hello',
}
- fs-copy-file - Asynchronously copies src to dest.
- fs-copy-file-sync - Synchronously copies src to dest.
MIT