1.1.3 • Published 4 years ago

@zhangfuxing/copydir v1.1.3

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

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
1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago