Comparing version 1.0.112 to 1.0.113
@@ -0,12 +1,24 @@ | ||
const fs = require('fs'); | ||
const Path = require('path'); | ||
module.exports = function loadConfig(fileName) { | ||
var config = {}; | ||
let configFile = ''; | ||
let config = {}; | ||
function loadConfig(fileName) { | ||
if (fileName == undefined) | ||
fileName = '.config'; | ||
var json = {}; | ||
try { | ||
var fs = require('fs'); | ||
json = JSON.parse(fs.readFileSync(fileName)); | ||
if (!fs.existsSync(configFile)) { | ||
configFile = Path.join(Path.dirname(process.argv[1]), fileName); | ||
} | ||
if (!fs.existsSync(configFile)) { | ||
configFile = Path.resolve(process.cwd(), fileName); | ||
} | ||
if (fs.existsSync(configFile)) { | ||
config = JSON.parse(fs.readFileSync(configFile)); | ||
} | ||
} | ||
@@ -17,10 +29,3 @@ catch(error) { | ||
json.load = loadConfig; | ||
return json; | ||
return config; | ||
} | ||
var config = loadConfig('.config'); | ||
module.exports = config; |
const fs = require('fs'); | ||
const Path = require('path'); | ||
function loadConfig(fileName) { | ||
module.exports = function loadConfig(fileName) { | ||
let configFile = ''; | ||
let config = {}; | ||
if (fileName == undefined) | ||
fileName = '.config'; | ||
try { | ||
@@ -27,3 +31,1 @@ if (!fs.existsSync(configFile)) { | ||
} | ||
module.exports = loadConfig('.config'); |
{ | ||
"name": "yow", | ||
"version": "1.0.112", | ||
"version": "1.0.113", | ||
"description": "You Only Wish module", | ||
@@ -5,0 +5,0 @@ "main": "yow.js", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
17925
420
9