Created
September 8, 2022 17:55
-
-
Save sabesansathananthan/e2cdc738cfdbd9bdcdcdb7bc297b3e6d to your computer and use it in GitHub Desktop.
How to copy files and folders in Node.js?
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
// copy file | |
fs.cp('./data.txt', './dest/info.txt', (err) => { | |
if (err) { | |
console.error(err); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment