mirror of
https://github.com/danbulant/bpm
synced 2026-06-11 10:30:23 +00:00
19 lines
No EOL
368 B
JavaScript
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;
|
|
}
|
|
} |