Skip to content

Instantly share code, notes, and snippets.

@Dianoga
Created July 23, 2021 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dianoga/2f6731e692bbd937ca74d06d73ffa038 to your computer and use it in GitHub Desktop.
Save Dianoga/2f6731e692bbd937ca74d06d73ffa038 to your computer and use it in GitHub Desktop.
node-mv with promises and typescript
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