mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 13:19:58 +00:00
17 lines
309 B
JavaScript
17 lines
309 B
JavaScript
|
import * as fs from "fs";
|
||
|
|
||
|
export function loadJSON(path) {
|
||
|
try {
|
||
|
return JSON.parse(fs.readFileSync(path, 'utf-8'))
|
||
|
} catch(e) {
|
||
|
return false
|
||
|
}
|
||
|
}
|
||
|
export function loadFile(path) {
|
||
|
try {
|
||
|
return fs.readFileSync(path, 'utf-8')
|
||
|
} catch(e) {
|
||
|
return false
|
||
|
}
|
||
|
}
|