@zhangfuxing/copydir
v1.1.3
Published
Copy files from one directory to another by nodejs
Downloads
3
Readme
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