Skip to content

Instantly share code, notes, and snippets.

@sabesansathananthan
Created September 8, 2022 17:58
Show Gist options
  • Save sabesansathananthan/8b7a3a927470da359b6e9a5c6e51d89d to your computer and use it in GitHub Desktop.
Save sabesansathananthan/8b7a3a927470da359b6e9a5c6e51d89d to your computer and use it in GitHub Desktop.
How to copy files and folders in Node.js?
// copy directory
fs.cp('./component', './page', { recursive: true }, (err) => {
if (err) {
console.error(err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment