Answers for "copy file fs"

3

copy a file and paste with fs

const fs = require('fs');

// File destination.txt will be created or overwritten by default.
fs.copyFile('source.txt', 'destination.txt', (err) => {
  if (err) throw err;
  console.log('source.txt was copied to destination.txt');
});
Posted by: Guest on January-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language