@fibjs/copy
v1.1.1
Published
copy file or directory recursively asynchronously.
Downloads
227
Readme
@fibjs/copy
copy file or directory recursively asynchronously.
Install
$ npm i @fibjs/copy --save
Usage
const copy = require('@fibjs/copy');
copy('path to source', 'path to target');
copy('path to source', 'path to target', data => {
// process the file buffer before write to the target
return data.toString() + 'foo';
});
copy('path to source', 'path to target', (data, dir) => {
if (dir.src.endsWith('xxx')) {
// ignore this path
return false;
}
return data;
});
copy('path to source', 'path to target', () => {
// doing nothing
return true;
});
Questions & Suggestions
Please open an issue here.