UNPKG

package-proxy

Version:
20 lines (19 loc) 442 B
/** @format */ import fs from "fs"; export const loadJSON = (path) => { try { const loadedFile = fs.readFileSync(path, "utf8"); return loadedFile; } catch (err) { throw err; } }; export const loadConfigJSON = (path) => { const file = loadJSON(path); return JSON.parse(file); }; export const loadPackageJSON = () => { const file = loadJSON("./package.json"); return JSON.parse(file); };