dataeditor api endpoints

This commit is contained in:
mrfry 2021-02-21 14:47:55 +01:00
parent 3e4fda9974
commit 5ca0abbabf
8 changed files with 373 additions and 116 deletions

View file

@ -11,6 +11,7 @@ export default {
CopyFile,
GetDateString,
formatUrl,
deleteFile: deleteFile,
}
import fs from 'fs'
@ -162,3 +163,11 @@ function AppendToFile(data: string, file: string): void {
console.error(err)
}
}
function deleteFile(fname: string): Boolean {
if (FileExists(fname)) {
fs.unlinkSync(fname)
return true
}
return false
}