MCPcopy Create free account
hub / github.com/node-config/node-config / initParam

Method initParam

lib/util.js:872–878  ·  view source on GitHub ↗

* Initialize a parameter from the command line or process environment * * * This method looks for the parameter from the command line in the format * --PARAMETER=VALUE, then from the process environment, then from the * default specified as an argument. * * *

(paramName, defaultValue)

Source from the content-addressed store, hash-verified

870 * @return {T} The found value, or default value
871 */
872 initParam(paramName, defaultValue) {
873 // Record and return the value
874 const value = this.getCmdLineArg(paramName) || process.env[paramName] || defaultValue;
875 this.setEnv(paramName, value);
876
877 return value;
878 }
879
880 /**
881 * <p>Get Command Line Arguments</p>

Callers 7

fromEnvironmentMethod · 0.95
initParamMethod · 0.45
getMethod · 0.45
runStrictnessChecksMethod · 0.45
config.mjsFile · 0.45
0-util.jsFile · 0.45
util.tsFile · 0.45

Calls 2

getCmdLineArgMethod · 0.95
setEnvMethod · 0.95

Tested by

no test coverage detected