Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@incanta/config

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@incanta/config - npm Package Compare versions

Comparing version 0.1.18 to 0.1.19

17

lib/config.js

@@ -19,2 +19,15 @@ "use strict";

this.customValues = {};
let defaultConfigDir = "config";
let defaultConfigEnv = "default";
if (fs_1.default.existsSync(path_1.default.join(process.cwd(), "config-settings.json"))) {
const configSettings = JSON.parse(fs_1.default.readFileSync(path_1.default.join(process.cwd(), "config-settings.json"), "utf-8"));
if (configSettings.defaults) {
if (configSettings.defaults.dir) {
defaultConfigDir = configSettings.defaults.configDir;
}
if (configSettings.defaults.env) {
defaultConfigEnv = configSettings.defaults.env;
}
}
}
this.configDir =

@@ -24,6 +37,6 @@ options?.configDir ||

path_1.default.relative(process.cwd(), process.env["NODE_CONFIG_DIR"])) ||
path_1.default.join(process.cwd(), "config");
path_1.default.join(process.cwd(), defaultConfigDir);
const defaultValues = loader_1.Loader.load(path_1.default.join(this.configDir, "default"));
let envValues = {};
const configEnvDir = options?.configEnv || process.env["NODE_CONFIG_ENV"];
const configEnvDir = options?.configEnv || process.env["NODE_CONFIG_ENV"] || defaultConfigEnv;
if (configEnvDir) {

@@ -30,0 +43,0 @@ if (fs_1.default.existsSync(path_1.default.join(this.configDir, configEnvDir))) {

2

package.json
{
"name": "@incanta/config",
"version": "0.1.18",
"version": "0.1.19",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "exports": {

@@ -23,2 +23,23 @@ import merge from "lodash.merge";

let defaultConfigDir = "config";
let defaultConfigEnv = "default";
if (fs.existsSync(path.join(process.cwd(), "config-settings.json"))) {
const configSettings = JSON.parse(
fs.readFileSync(
path.join(process.cwd(), "config-settings.json"),
"utf-8"
)
);
if (configSettings.defaults) {
if (configSettings.defaults.dir) {
defaultConfigDir = configSettings.defaults.configDir;
}
if (configSettings.defaults.env) {
defaultConfigEnv = configSettings.defaults.env;
}
}
}
this.configDir =

@@ -28,3 +49,3 @@ options?.configDir ||

path.relative(process.cwd(), process.env["NODE_CONFIG_DIR"])) ||
path.join(process.cwd(), "config");
path.join(process.cwd(), defaultConfigDir);

@@ -34,3 +55,4 @@ const defaultValues = Loader.load(path.join(this.configDir, "default"));

let envValues: any = {};
const configEnvDir = options?.configEnv || process.env["NODE_CONFIG_ENV"];
const configEnvDir =
options?.configEnv || process.env["NODE_CONFIG_ENV"] || defaultConfigEnv;
if (configEnvDir) {

@@ -37,0 +59,0 @@ if (fs.existsSync(path.join(this.configDir, configEnvDir))) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc