@zhangfuxing/copydir
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

copydir

Copy files from one directory to another by nodejs

Install

$ npm i @zhangfuxing/copydir

Options

/**
 * copy files from one directory to another
 *   - `src` source directory
 *   - `dest` destination directory
 *   - `includeSrc` Whether to include the source folder, default: false
 */
declare function copydir(src: string, dest: string, includeSrc?: boolean): Promise<void>  

Useage

Doesn't include the source folder

const copydir = require('@zhangfuxing/copydir');
const src = './test/src';
const dest = './test/dest';

(async () => {
  await copydir(src, dest);
})().catch(console.error);

Including the source folder

const copydir = require('@zhangfuxing/copydir');
const src = './test/src';
const dest = './test/dest';

(async () => {
  await copydir(src, dest, true);
})().catch(console.error);

Test

$ npm test

Readme

Keywords

Package Sidebar

Install

npm i @zhangfuxing/copydir

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

4.17 kB

Total Files

5

Last publish

Collaborators

  • fuxingzhang