Skip to content

Commit d2f7225

Browse files
authored
Update Node Target Mapping based on tsconfig bases (#347)
1 parent 19223bf commit d2f7225

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

Node-Target-Mapping.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,48 @@ You can also use https://github.com/tsconfig/bases/ to find `tsconfig.json`s to
77

88
To update this file, you can use [node.green](https://node.green) to map to the different options in [microsoft/typescript@src/lib](https://github.com/Microsoft/TypeScript/tree/main/src/lib)
99

10+
#### Node 24
11+
12+
```json
13+
{
14+
"compilerOptions": {
15+
"lib": ["ES2024"],
16+
"module": "nodenext",
17+
"target": "ES2024"
18+
}
19+
}
20+
```
21+
22+
Note: [`module` is set to `nodenext` to allow `require("esm")`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-8.html#support-for-require-of-ecmascript-modules-in---module-nodenext). After TypeScript 5.9 is released, it is recommended to set it to `node20` instead.
23+
24+
#### Node 22
25+
26+
```json
27+
{
28+
"compilerOptions": {
29+
"lib": ["ES2023"],
30+
"module": "nodenext",
31+
"target": "ES2023"
32+
}
33+
}
34+
```
35+
36+
Note: [`module` is set to `nodenext` to allow `require("esm")`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-8.html#support-for-require-of-ecmascript-modules-in---module-nodenext). After TypeScript 5.9 is released, it is recommended to set it to `node20` instead.
37+
1038
#### Node 20
1139

1240
```json
1341
{
1442
"compilerOptions": {
1543
"lib": ["ES2023"],
16-
"module": "node16",
44+
"module": "nodenext",
1745
"target": "ES2023"
1846
}
1947
}
2048
```
2149

50+
Note: [`module` is set to `nodenext` to allow `require("esm")`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-8.html#support-for-require-of-ecmascript-modules-in---module-nodenext). After TypeScript 5.9 is released, it is recommended to set it to `node20` instead.
51+
2252
#### Node 18
2353

2454
```json

0 commit comments

Comments
 (0)