GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: support multiple versions in node.config.json · nodejs/node@0c6040b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc
    • api
      • cli.md
    • node-config-schema.json
  • lib/internal
    • options.js
  • src
    • node_config_file.cc
    • node_config_file.h
  • test/parallel
    • test-config-file.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/cli.md‎

Copy file name to clipboardExpand all lines: doc/api/cli.md
+38Lines changed: 38 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,44 @@ The configuration file supports namespace-specific options:
10411041

10421042
* Namespace fields like `test`, `watch`, and `permission` contain configuration specific to that subsystem.
10431043

1044+
The configuration file can target a specific Node.js major version with
1045+
`nodeVersion`:
1046+
1047+
```json
1048+
{
1049+
"nodeVersion": 25,
1050+
"nodeOptions": {
1051+
"watch-path": "src"
1052+
}
1053+
}
1054+
```
1055+
1056+
To keep multiple version-specific configurations in the same file, use the
1057+
`configs` array. Node.js will use the first entry whose `nodeVersion` matches
1058+
the current Node.js major version:
1059+
1060+
```json
1061+
{
1062+
"$schema": "https://nodejs.org/dist/latest-v26.x/docs/node-config-schema.json",
1063+
"configs": [
1064+
{
1065+
"nodeVersion": 25,
1066+
"config": {
1067+
"$schema": "https://nodejs.org/dist/latest-v25.x/docs/node-config-schema.json",
1068+
"nodeOptions": {
1069+
"watch-path": "src"
1070+
}
1071+
}
1072+
}
1073+
]
1074+
}
1075+
```
1076+
1077+
When `configs` is used, the top level may only contain `$schema` and
1078+
`configs`. Each `configs` item must define an integer `nodeVersion` and an
1079+
object `config`. A single top-level config does not require `nodeVersion`, but
1080+
if present it must match the current Node.js major version.
1081+
10441082
When a namespace is present in the
10451083
configuration file, Node.js automatically enables the corresponding flag
10461084
(e.g., `--test`, `--watch`, `--permission`). This allows you to configure

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.