mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
dataeditor api endpoints
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user