api: flatten code directories, better filenames, remove old files
This commit is contained in:
16
api/src/misc/load-from-fs.js
Normal file
16
api/src/misc/load-from-fs.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as fs from "fs";
|
||||
|
||||
export function loadJSON(path) {
|
||||
try {
|
||||
return JSON.parse(fs.readFileSync(path, 'utf-8'))
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
export function loadFile(path) {
|
||||
try {
|
||||
return fs.readFileSync(path, 'utf-8')
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user