Usage:
const mvdir = require('mvdir');
await mvdir('source/file.js', 'dest/file.js');
await mvdir('source/file.js', 'dest/');
await mvdir('source', 'dest');
await mvdir('source', 'a/b/c/dest');
await mvdir('file1.js', 'D:\\file.js');
mvdir('source/file.js', 'dest/file.js').then(success => {
if (success) console.log('done.');
});
Copying:
await mvdir('file1.js', 'file2.js', { copy: true });
await mvdir('dir1', 'dir2', { copy: true });
Don't overwrite:
await mvdir('file1.js', 'file2.js', { overwrite: false });
await mvdir('dir1', 'dir2', { overwrite: false });