Skip to content

copy file or directory recursively asynchronously

License

Notifications You must be signed in to change notification settings

fibjs-modules/copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@fibjs/copy

NPM version build status appveyor build status Test coverage David deps Known Vulnerabilities npm download

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.

License

MIT

About

copy file or directory recursively asynchronously

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published