bpm/modules/package.js
2020-02-19 17:11:21 +01:00

19 lines
No EOL
368 B
JavaScript

const fs = require("fs");
module.exports = class Package {
pkg = {};
load(path){
if(!fs.existsSync(path))throw Error("Path doesn't exists!");
try {
var json = JSON.parse(fs.readFileSync(path));
} catch(e){
throw Error("Invalid JSON file");
}
this.pkg = json;
return json;
}
}