diff --git a/doc/api/cli.md b/doc/api/cli.md index 9c5af91ae13f91..91e36644a1d6ec 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -911,6 +911,59 @@ added: v23.6.0 Enable experimental import support for `.node` addons. +### `--experimental-config-file` + + + +> Stability: 1.0 - Early development + +Use this flag to specify a configuration file that will be loaded and parsed +before the application starts. +Node.js will read the configuration file and apply the settings. +The configuration file should be a JSON file +with the following structure: + +```json +{ + "experimental_transform_types": true, + "import": [ + "amaro/transform" + ] +} +``` + +Each key in the configuration file corresponds to a flag that can be passed +as a command-line argument. The value of the key is the value that would be +passed to the flag. + +For example, the configuration file above is equivalent to +the following command-line arguments: + +```bash +node --experimental-transform-types --import amaro/transform +``` + +The priority in configuration is as follows: + +* NODE\_OPTIONS and command-line options +* Config file +* Dotenv NODE\_OPTIONS + +If multiple keys are present in the configuration file, +the last one will override the previous ones. +Unknown keys will be ignored. + +It possible to use the official json schema to validate the configuration file, +which may vary depending on the Node.js version. + +```json +{ + "$schema": "https://nodejs.org/dist/REPLACEME/node_config_json_schema.json", +} +``` + ### `--experimental-eventsource`