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

config-ninja

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config-ninja - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

9

configNinja.js

@@ -16,3 +16,3 @@ 'use strict';

*/
const readConfigFile = function (type, name, dir, configInFilename) {
const readConfigFile = function (type, name, dir, configInFilename, ignoreMissing) {

@@ -25,3 +25,5 @@ const filename = path.join(dir, `${name}${configInFilename ? '.config' : ''}.json`);

} catch (err) {
throw new Error(`Unable to read ${type} config "${name}" (${err.code}).`);
if (!ignoreMissing) {
throw new Error(`Unable to read ${type} config "${name}" (${err.code}).`);
}
}

@@ -59,2 +61,3 @@

additionalMergeFiles: [],
ignoreMissingAdditional: true,
}, _options);

@@ -104,3 +107,3 @@

addCfg = readConfigFile('additional', additionalMergeFile, dir, options.configInFilename);
addCfg = readConfigFile('additional', additionalMergeFile, dir, options.configInFilename, options.ignoreMissingAdditional);
addCfg = parseConfigJSON('additional', additionalMergeFile, addCfg);

@@ -107,0 +110,0 @@

@@ -13,3 +13,3 @@ {

"name": "config-ninja",
"version": "0.1.0",
"version": "0.1.1",
"description": "Environmental JSON config.",

@@ -16,0 +16,0 @@ "keywords": [

@@ -48,6 +48,7 @@ # Config-Ninja

| Property | Default | Description |
|------------------------|---------|-------------|
| configInFilename | true | Set false if you want to your config filenames to be in the format of `development.json` instead of the default `development.config.json`. |
| additionalMergeFiles[] | | Specify a list of other filenames to merge into your config, if the files don't exist they will just be ignored. Properties in additional files will overwrite properties with the same name in your config. |
| Property | Default | Description |
|-------------------------|---------|-------------|
| configInFilename | true | Set false if you want to your config filenames to be in the format of `development.json` instead of the default `development.config.json`. |
| additionalMergeFiles[] | | Specify a list of other filenames to merge into your config, if the files don't exist they will just be ignored. Properties in additional files will overwrite properties with the same name in your config. |
| ignoreMissingAdditional | true | By default we don't throw an error if an additional config file is missing. |

@@ -54,0 +55,0 @@ ## Reserved Property Names

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