1const fse = require('fs-extra');
2
3const srcDir = `path/to/file`;
4const destDir = `path/to/destination/directory`;
5
6// To copy a folder or file
7fse.copySync(srcDir, destDir, function (err) {
8 if (err) { ^
9 console.error(err); |___{ overwrite: true } // add if you want to replace existing folder or file with same name
10 } else {
11 console.log("success!");
12 }
13});
14