mirror of
https://github.com/hexahigh/cdn.git
synced 2025-12-11 20:15:22 +01:00
create node.js copy
This commit is contained in:
parent
f8c5c2769e
commit
898c096a0f
18
js/copyAndMove.js
Normal file
18
js/copyAndMove.js
Normal file
@ -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!')
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user