Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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');
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #copy #file #paste #fs
ADD COMMENT
Topic
Name
2+3 =