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

config

Package Overview
Dependencies
Maintainers
2
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

config - npm Package Compare versions

Comparing version 1.30.0 to 1.31.0

5

History.md

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

1.31.0 / 2018-05-22
===================
* Load new coffeescript module instead of coffee-script - bastbijl
1.30.0 / 2018-02-26

@@ -2,0 +7,0 @@ ===================

61

lib/config.js

@@ -36,3 +36,4 @@ // config.js (c) 2010-2015 Loren West and other contributors

// Define soft dependencies so transpilers don't include everything
var COFFEE_DEP = "coffee-script",
var COFFEE_2_DEP = "coffeescript",
COFFEE_DEP = "coffee-script",
ICED_DEP = "iced-coffee-script",

@@ -665,2 +666,5 @@ JS_YAML_DEP = "js-yaml",

// Split files name, for loading multiple files.
NODE_ENV = NODE_ENV.split(',');
CONFIG_DIR = configDir || util.initParam('NODE_CONFIG_DIR', Path.join( process.cwd(), 'config') );

@@ -696,3 +700,3 @@ if (CONFIG_DIR.indexOf('.') === 0) {

// Read each file in turn
var baseNames = ['default', NODE_ENV];
var baseNames = ['default'].concat(NODE_ENV);

@@ -703,12 +707,16 @@ // #236: Also add full hostname when they are different.

// Backward compatibility
baseNames.push(firstDomain, firstDomain + '-' + NODE_ENV);
NODE_ENV.forEach(function(env) {
// Backward compatibility
baseNames.push(firstDomain, firstDomain + '-' + env);
// Add full hostname when it is not the same
if ( hostName != firstDomain ) {
baseNames.push(hostName, hostName + '-' + NODE_ENV);
}
// Add full hostname when it is not the same
if ( hostName != firstDomain ) {
baseNames.push(hostName, hostName + '-' + env);
}
});
}
baseNames.push('local', 'local-' + NODE_ENV);
NODE_ENV.forEach(function(env) {
baseNames.push('local', 'local-' + env);
});

@@ -926,3 +934,10 @@ var extNames = ['js', 'ts', 'json', 'json5', 'hjson', 'toml', 'coffee', 'iced', 'yaml', 'yml', 'cson', 'properties', 'xml'];

Coffee = require(COFFEE_DEP);
try {
// Try to load coffeescript
Coffee = require(COFFEE_2_DEP);
}
catch (e) {
// If it doesn't exist, try to load it using the deprecated module name
Coffee = require(COFFEE_DEP);
}

@@ -1719,11 +1734,16 @@ // coffee-script >= 1.7.0 requires explicit registration for require() to work

// Throw an exception if there's no explicit config file for NODE_ENV
var anyFilesMatchEnv = sourceFilenames.some(function (filename) {
return filename.match(NODE_ENV);
NODE_ENV.forEach(function(env) {
// Throw an exception if there's no explicit config file for NODE_ENV
var anyFilesMatchEnv = sourceFilenames.some(function (filename) {
return filename.match(env);
});
// development is special-cased because it's the default value
if (env && (env !== 'development') && !anyFilesMatchEnv) {
_warnOrThrow("NODE_ENV value of '"+env+"' did not match any deployment config file names.");
}
// Throw if NODE_ENV matches' default' or 'local'
if ((env === 'default') || (env === 'local')) {
_warnOrThrow("NODE_ENV value of '"+env+"' is ambiguous.");
}
});
// development is special-cased because it's the default value
if (NODE_ENV && (NODE_ENV !== 'development') && !anyFilesMatchEnv) {
_warnOrThrow("NODE_ENV value of '"+NODE_ENV+"' did not match any deployment config file names.");
}

@@ -1738,7 +1758,2 @@ // Throw an exception if there's no explict config file for NODE_APP_INSTANCE

// Throw if NODE_ENV matches' default' or 'local'
if ((NODE_ENV === 'default') || (NODE_ENV === 'local')) {
_warnOrThrow("NODE_ENV value of '"+NODE_ENV+"' is ambiguous.");
}
function _warnOrThrow (msg) {

@@ -1745,0 +1760,0 @@ var beStrict = process.env.NODE_CONFIG_STRICT_MODE;

{
"name": "config",
"version": "1.30.0",
"version": "1.31.0",
"main": "./lib/config.js",

@@ -22,8 +22,7 @@ "description": "Configuration control for production node deployments",

"dependencies": {
"json5": "0.4.0",
"os-homedir": "1.0.2"
"json5": "^1.0.1"
},
"devDependencies": {
"@types/node": "^7.0.8",
"coffee-script": ">=1.7.0",
"coffeescript": "2.2.4",
"cson": "^3.0.1",

@@ -30,0 +29,0 @@ "hjson": "^1.2.0",

@@ -158,6 +158,7 @@ Configure your Node.js Applications

<td><img src=https://avatars1.githubusercontent.com/u/9355665?v=4><a href="https://github.com/kgoerlitz">kgoerlitz</a></td>
<td><img src=https://avatars3.githubusercontent.com/u/8650543?v=4><a href="https://github.com/leonardovillela">leonardovillela</a></td>
<td><img src=https://avatars3.githubusercontent.com/u/1918551?v=4><a href="https://github.com/nitzan-shaked">nitzan-shaked</a></td>
<td><img src=https://avatars3.githubusercontent.com/u/3058150?v=4><a href="https://github.com/robertrossmann">robertrossmann</a></td>
<td><img src=https://avatars2.githubusercontent.com/u/498929?v=4><a href="https://github.com/roncli">roncli</a></td>
</tr><tr><td><img src=https://avatars2.githubusercontent.com/u/1355559?v=4><a href="https://github.com/superoven">superoven</a></td>
</tr><tr><td><img src=https://avatars2.githubusercontent.com/u/498929?v=4><a href="https://github.com/roncli">roncli</a></td>
<td><img src=https://avatars2.githubusercontent.com/u/1355559?v=4><a href="https://github.com/superoven">superoven</a></td>
<td><img src=https://avatars2.githubusercontent.com/u/54934?v=4><a href="https://github.com/wmertens">wmertens</a></td>

@@ -167,3 +168,2 @@ <td><img src=https://avatars3.githubusercontent.com/u/2842176?v=4><a href="https://github.com/XadillaX">XadillaX</a></td>

<td><img src=https://avatars0.githubusercontent.com/u/2015295?v=4><a href="https://github.com/patrickpilch">patrickpilch</a></td>
<td><img src=https://avatars1.githubusercontent.com/u/618330?v=4><a href="https://github.com/adityabansod">adityabansod</a></td>
</tr></table>

@@ -170,0 +170,0 @@

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