◐ Shell
clean mode source ↗

src: set default config as node.config.json · nodejs/node@274c18a

@@ -919,29 +919,30 @@ flows within the application. As such, it is presently recommended to be sure

919919

your application behaviour is unaffected by this change before using it in

920920

production.

921921922-

### `--experimental-config-file`

922+

### `--experimental-config-file=config`

923923924924

<!-- YAML

925925

added: REPLACEME

926926

-->

927927928928

> Stability: 1.0 - Early development

929929930-

Use this flag to specify a configuration file that will be loaded and parsed

931-

before the application starts.

930+

If present, Node.js will look for a

931+

configuration file at the specified path.

932932

Node.js will read the configuration file and apply the settings.

933933

The configuration file should be a JSON file

934934

with the following structure:

935935936+

> \[!NOTE]

937+

> Replace `vX.Y.Z` in the `$schema` with the version of Node.js you are using.

938+936939

```json

937940

{

938-

"$schema": "https://nodejs.org/dist/REPLACEME/docs/node_config_json_schema.json",

941+

"$schema": "https://nodejs.org/dist/vX.Y.Z/docs/node-config-schema.json",

939942

"nodeOptions": {

940-

"experimental-transform-types": true,

941943

"import": [

942-

"amaro/transform"

944+

"amaro/strip"

943945

],

944-

"disable-warning": "ExperimentalWarning",

945946

"watch-path": "src",

946947

"watch-preserve-output": true

947948

}

@@ -952,7 +953,7 @@ In the `nodeOptions` field, only flags that are allowed in [`NODE_OPTIONS`][] ar

952953

No-op flags are not supported.

953954

Not all V8 flags are currently supported.

954955955-

It is possible to use the [official JSON schema](../node_config_json_schema.json)

956+

It is possible to use the [official JSON schema](../node-config-schema.json)

956957

to validate the configuration file, which may vary depending on the Node.js version.

957958

Each key in the configuration file corresponds to a flag that can be passed

958959

as a command-line argument. The value of the key is the value that would be

@@ -962,7 +963,7 @@ For example, the configuration file above is equivalent to

962963

the following command-line arguments:

963964964965

```bash

965-

node --experimental-transform-types --import amaro/transform --disable-warning=ExperimentalWarning --watch-path=src --watch-preserve-output

966+

node --import amaro/strip --watch-path=src --watch-preserve-output

966967

```

967968968969

The priority in configuration is as follows:

@@ -984,6 +985,18 @@ unknown keys or keys that cannot used in `NODE_OPTIONS`.

984985

Node.js will not sanitize or perform validation on the user-provided configuration,

985986

so **NEVER** use untrusted configuration files.

986987988+

### `--experimental-default-config-file`

989+990+

<!-- YAML

991+

added: REPLACEME

992+

-->

993+994+

> Stability: 1.0 - Early development

995+996+

If the `--experimental-default-config-file` flag is present, Node.js will look for a

997+

`node.config.json` file in the current working directory and load it as a

998+

as configuration file.

999+9871000

### `--experimental-eventsource`

98810019891002

<!-- YAML