1.0.1 • Published 6 years ago

@fuxingzhang/movedir v1.0.1

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

movedir

move files from one directory to another by nodejs

Install

$ npm i @fuxingzhang/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('@fuxingzhang/movedir');
const src = './test/src';
const dest = './test/dest';

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

Including the source folder

const movedir = require('@fuxingzhang/movedir');
const src = './test/src';
const dest = './test/dest';

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

Test

$ npm test
1.0.1

6 years ago

1.0.0

6 years ago