Answers for "copy directory in nodejs"


copy directory in nodejs

const fse = require('fs-extra');

const srcDir = `path/to/file`;
const destDir = `path/to/destination/directory`;
// To copy a folder or file  
fse.copySync(srcDir, destDir, function (err) {
  if (err) {                 ^
    console.error(err);      |___{ overwrite: true } // add if you want to replace existing folder or file with same name
  } else {
Posted by: Guest on July-26-2021

copy folder in nodejs

copydir.sync(from, to[, options]);
Posted by: Guest on June-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language