1//copyfile.js
2const fs = require('fs');
3
4// destination will be created or overwritten by default.
5fs.copyFile('C:\folderA\myfile.txt', 'C:\folderB\myfile.txt', (err) => {
6 if (err) throw err;
7 console.log('File was copied to destination');
8});