Socket
Socket
Sign inDemoInstall

peafowl

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

21

lib/index.js

@@ -1,17 +0,14 @@

'use strict';
const map = new WeakMap();
const fs = require('fs');
let getEnvironment = () => {
return process.env.NODE_ENV || 'development';
},
settings;
class Config {
constructor() {
settings = JSON.parse(fs.readFileSync('config/' + getEnvironment() + '.json', 'utf8'));
map.set(this, require(`${__dirname}/../config/${this.getEnvironment()}.json`));
}
getEnvironment() {
return process.env.NODE_ENV || 'development';
}
get(path) {
let obj = settings;
let obj = map.get(this);

@@ -23,3 +20,3 @@ path.split('/').forEach((key) => {

throw new Error('Trying to get "' + path + '" but key "' + key + '" was not found');
throw new Error(`Trying to get "${path}" but key "${key}" was not found`);
});

@@ -33,3 +30,3 @@

last = keys.pop(),
obj = settings;
obj = map.get(this);

@@ -36,0 +33,0 @@ keys.forEach((key) => {

{
"name": "peafowl",
"version": "0.1.0",
"version": "0.2.0",
"description": "",

@@ -13,5 +13,5 @@ "main": "lib/index.js",

"code": "^4.0.0",
"lab": "^11.1.0",
"lab": "^14.3.1",
"plato": "^1.7.0"
}
}

@@ -1,7 +0,6 @@

'use strict';
const Lab = require('lab'),
const
Lab = require('lab'),
Code = require('code'),
lab = exports.lab = Lab.script(),
config = require('lib/index');
config = require(`${__dirname}/../lib/index`);

@@ -8,0 +7,0 @@ lab.experiment('Config', () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc