You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
419 B

'use strict'
const fs = require('graceful-fs')
const FileUtils = {
readFile (path) {
return fs.readFileSync(path).toString()
},
saveFile (path, content) {
fs.writeFileSync(path, content)
},
copyFile (src, dest) {
FileUtils.saveFile(dest, FileUtils.readFile(src))
},
removeFileIfExists (src) {
if (fs.existsSync(src)) {
fs.unlinkSync(src)
}
}
}
module.exports = FileUtils