-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
Proposal: --config=file command line argument #11997
Copy link
Copy link
Closed
Labels
cliIssues and PRs related to the Node.js command line interface.Issues and PRs related to the Node.js command line interface.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Metadata
Metadata
Assignees
Labels
cliIssues and PRs related to the Node.js command line interface.Issues and PRs related to the Node.js command line interface.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Type
Fields
Give feedbackNo fields configured for issues without a type.
In a number of conversations (e.g. #11888), the idea of introducing either a
NODEOPTenvironment variable that would allow arbitrary command line flags to be set via the environment, or a.nodercconfiguration file that could provide configuration options has been discussed. These choices have their merits and their disadvantages. One of the key disadvantages for me is the potential for the configuration collisions across applications and spooky action coming from environment settings that are unknown to the user. I much prefer explicit opt-in solutions.One approach that could work that can potentially fill the gap is allowing configuration settings to be set using a
.noderctype configuration file that is explicitly passed in via command line argument:$ node --config=/some/path/.noderc app.jsIf a user wanted to make use of environment variables in various environments, they could easily do so via variable expansion: