diff --git a/js/copyAndMove.js b/js/copyAndMove.js new file mode 100644 index 0000000..6b6a5e3 --- /dev/null +++ b/js/copyAndMove.js @@ -0,0 +1,18 @@ +const fs = require('fs') + +var AX = {} + +AX.copy = function (source, output) { + //var SBuff = fs.readFileSync(source) + fs.writeFileSync(output, fs.readFileSync(source), function (err) { + if (err) throw err + console.log('Successfully copied file!') + }) +} + +AX.move = function (source, destination) { + fs.rename(source, destination, function (err) { + if (err) throw err + console.log('Successfully moved - AKA renamed!') + }) +} \ No newline at end of file