@npmcli/config
Advanced tools
Comparing version 3.0.1 to 4.0.0
// replace any ${ENV} values with the appropriate environ. | ||
const envExpr = /(\\*)\$\{([^}]+)\}/g | ||
const envExpr = /(?<!\\)(\\*)\$\{([^${}]+)\}/g | ||
@@ -5,0 +5,0 @@ module.exports = (f, env) => f.replace(envExpr, (orig, esc, name) => { |
@@ -8,2 +8,3 @@ // TODO: set the scope config from package.json or explicit cli config | ||
const rpj = require('read-package-json-fast') | ||
const log = require('proc-log') | ||
@@ -92,3 +93,2 @@ /* istanbul ignore next */ | ||
argv = process.argv, | ||
log = require('proc-log'), | ||
platform = process.platform, | ||
@@ -119,3 +119,2 @@ execPath = process.execPath, | ||
this.npmPath = npmPath | ||
this.log = log | ||
this.argv = argv | ||
@@ -442,3 +441,3 @@ this.env = env | ||
invalidHandler (k, val, type, source, where) { | ||
this.log.warn( | ||
log.warn( | ||
'invalid config', | ||
@@ -476,3 +475,3 @@ k + '=' + JSON.stringify(val), | ||
.join(', ') | ||
this.log.warn('invalid config', msg, desc) | ||
log.warn('invalid config', msg, desc) | ||
} | ||
@@ -499,3 +498,3 @@ | ||
if (er.code !== 'ENOENT') { | ||
this.log.verbose('config', `error loading ${where} config`, er) | ||
log.verbose('config', `error loading ${where} config`, er) | ||
} | ||
@@ -519,3 +518,3 @@ } else { | ||
if (this.deprecated[key]) { | ||
this.log.verbose('config', key, this.deprecated[key]) | ||
log.verbose('config', key, this.deprecated[key]) | ||
} | ||
@@ -617,3 +616,3 @@ } | ||
if (hasNpmrc) { | ||
this.log.warn(`ignoring workspace config at ${this.localPrefix}/.npmrc`) | ||
log.warn(`ignoring workspace config at ${this.localPrefix}/.npmrc`) | ||
} | ||
@@ -625,3 +624,3 @@ | ||
this.localPrefix = p | ||
this.log.info(`found workspace root at ${this.localPrefix}`) | ||
log.info(`found workspace root at ${this.localPrefix}`) | ||
// we found a root, so we return now | ||
@@ -628,0 +627,0 @@ return |
{ | ||
"name": "@npmcli/config", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "bin", |
@@ -81,7 +81,10 @@ # `@npmcli/config` | ||
cwd: process.cwd(), | ||
// optional, defaults to emitting 'log' events on process object | ||
// only silly, verbose, warn, and error are logged by this module | ||
log: require('proc-log') | ||
}) | ||
// emits log events on the process object | ||
// see `proc-log` for more info | ||
process.on('log', (level, ...args) => { | ||
console.log(level, ...args) | ||
}) | ||
// returns a promise that fails if config loading fails, and | ||
@@ -128,4 +131,2 @@ // resolves when the config object is ready for action | ||
`globalPrefix`. | ||
- `log` Optional, the object used to log debug messages, warnings, and | ||
errors. Defaults to emitting on the `process` object. | ||
- `env` Optional, defaults to `process.env`. Source of the environment | ||
@@ -166,3 +167,2 @@ variables for configuration. | ||
- `platform` The `platform` param | ||
- `log` The `log` param | ||
- `defaults` The `defaults` param | ||
@@ -169,0 +169,0 @@ - `shorthands` The `shorthands` param |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
47746
1066