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

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i @zhangfuxing/movedir

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

4.23 kB

Total Files

5

Last publish

Collaborators

  • fuxingzhang