Created
July 23, 2021 15:12
-
-
Save Dianoga/2f6731e692bbd937ca74d06d73ffa038 to your computer and use it in GitHub Desktop.
node-mv with promises and typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mv from 'mv'; | |
export function mvp( | |
src: string, | |
dest: string, | |
options: mv.Options = {} | |
): Promise<void> { | |
return new Promise((resolve, reject) => { | |
mv(src, dest, options, (error) => { | |
if (error) reject(error); | |
resolve(); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment