Comparing version 2.1.1 to 2.2.0
39
index.js
@@ -8,5 +8,12 @@ // Gather initial information | ||
var platform = '' | ||
var minimal = false | ||
// Process dependent fields | ||
// Boolean helper | ||
function toBoolean(val) { | ||
return (!val || val === 'false') ? false : true | ||
} | ||
// Process dependent | ||
if (typeof process !== 'undefined') { | ||
// Platform | ||
if (process.platform) { | ||
@@ -16,20 +23,22 @@ platform = String(process.platform) | ||
// TTY | ||
if (process.stdout) { | ||
tty = toBoolean(process.stdout.isTTY) | ||
} | ||
// Is CI | ||
isCI = Boolean(require('ci-info').isCI) | ||
// Env dependent | ||
if (process.env) { | ||
// isCI | ||
isCI = Boolean(require('ci-info').isCI) | ||
// NODE_ENV | ||
if (process.env.NODE_ENV) { | ||
nodeENV = String(process.env.NODE_ENV) | ||
nodeENV = process.env.NODE_ENV | ||
} | ||
// DEBUG | ||
if (process.DEBUG) { | ||
debug = Boolean(process.env.DEBUG) | ||
} | ||
debug = toBoolean(process.env.DEBUG) | ||
// TTY | ||
if (process.stdout) { | ||
tty = Boolean(process.stdout.isTTY) | ||
} | ||
// MINIMAL | ||
minimal = toBoolean(process.env.MINIMAL) | ||
} | ||
@@ -50,2 +59,3 @@ } | ||
minimal: undefined, | ||
minimalCLI: undefined, | ||
@@ -58,6 +68,7 @@ | ||
// Compute minimalCLI | ||
env.minimalCLI = env.ci || env.test || !env.tty | ||
// Compute minimal | ||
env.minimal = minimal || env.ci || env.test || !env.tty | ||
emv.minimalCLI = env.minimal | ||
// Export env | ||
module.exports = Object.freeze(env) |
{ | ||
"name": "std-env", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Detect running environment of the current Node.js process", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"repository": "blindmedia/std-env", | ||
"repository": "jsless/std-env", | ||
"contributes": [ | ||
@@ -9,0 +9,0 @@ "Pooya Parsa <pooya@pi0.ir>" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
2340
56
6