@zhangfuxing/movedir
v1.0.2
Published
Move files from one directory to another by nodejs
Downloads
1
Maintainers
Readme
movedir
move files from one directory to another by nodejs
Install
$ npm i @zhangfuxing/movedir
Options
/**
* move files from one directory to another
* - `src` source directory
* - `dest` destination directory
* - `includeSrc` Whether to include the source folder, default: false
*/
declare function movedir(src: string, dest: string, includeSrc?: boolean): Promise<void>
Useage
Doesn't include the source folder
const movedir = require('@zhangfuxing/movedir');
const src = './test/src';
const dest = './test/dest';
(async () => {
await movedir(src, dest);
})().catch(console.error);
Including the source folder
const movedir = require('@zhangfuxing/movedir');
const src = './test/src';
const dest = './test/dest';
(async () => {
await movedir(src, dest, true);
})().catch(console.error);
Test
$ npm test