Why?
I did this: npm i mv
,
then I saw this: + mv@2.1.1 added 15 packages
,
then I said no.
It first tries fs.rename()
, then falls back on fs.copyFile()
and fs.unlink()
.
Usage:
const mvdir = ; await ; // move file.await ; // move file. (same as above if dest directory already exists)await ; // move directory.await ; // creating necessary dirs.await ; // move across drives/partitions. // returns undefined if successful, or an error object:const err = await ;if !err console; ;
Copying:
await ;await ;
Don't overwrite:
await ; // error if file2.js already exists.await ; // error if dir2 already exists.
Don't log errors:
await ;