Node fs copy a folder

You can use fs-extra to copy contents of one folder to another like this

var fs = require("fs-extra");

fs.copy('/path/to/source', '/path/to/destination', function (err) {
  if (err) return console.error(err)
  console.log('success!')
});

There’s also a synchronous version.

fs.copySync('/path/to/source', '/path/to/destination')

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)