Skip to content

coderaiser/files-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9aa6c87 · Jan 28, 2021

History

84 Commits
Jan 25, 2021
Jan 25, 2021
Jan 25, 2021
Jan 25, 2021
Jan 25, 2021
Jan 25, 2021
Jan 25, 2021
Jan 25, 2021
Jan 26, 2021
Aug 12, 2014
Jan 28, 2021
Jan 26, 2021

Repository files navigation

Files-io License NPM version Dependency Status Build Status Coverage Status

Read many files with node.

Install

npm i files-io --save

How to use?

const files = require('files-io');

const allData = await files.read(['README.md', 'package.json'], 'utf8');
console.log(allData);

/* Easy way to create pipe which would handle all error events */
const NameFrom = 'README.md';
const NameTo = 'README_COPY.gz';

await files.pipe(NameFrom, NameTo, {
    gzip: true,
});
/* join couple files and save them to new file with streams */
const fs = require('fs');
const NAME = 'Join';
const writeStream = fs.createWriteStream(NAME);

await files.readPipe(['README.md', 'package.json'], writeStream);

License

MIT