From 4c1eae1955f6aa1a2e779d14b2fa7149f85a608d Mon Sep 17 00:00:00 2001 From: danbulant Date: Wed, 19 Feb 2020 19:57:47 +0100 Subject: [PATCH] Fallback to cwd --- modules/parser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/parser.js b/modules/parser.js index c1d74f9..c8828a8 100644 --- a/modules/parser.js +++ b/modules/parser.js @@ -3,7 +3,9 @@ var console = new Console; module.exports = class PackageParser { load(path){ - if (!fs.existsSync(path)) throw Error("Path doesn't exists!"); + if(!path) path = process.cwd() + "/package.json"; + + if (!fs.existsSync(path)) throw Error("Package.json doesn't exists!"); try { var json = JSON.parse(fs.readFileSync(path));