mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 20:59:59 +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
|
||
|
}
|
||
|
}
|