Skip to content

Update Node Target Mapping based on tsconfig bases #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion Node-Target-Mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,48 @@ You can also use https://github.com/tsconfig/bases/ to find `tsconfig.json`s to

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)

#### Node 24

```json
{
"compilerOptions": {
"lib": ["ES2024"],
"module": "nodenext",
"target": "ES2024"
}
}
```

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.

#### Node 22

```json
{
"compilerOptions": {
"lib": ["ES2023"],
"module": "nodenext",
"target": "ES2023"
}
}
```

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.

#### Node 20

```json
{
"compilerOptions": {
"lib": ["ES2023"],
"module": "node16",
"module": "nodenext",
"target": "ES2023"
}
}
```

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.

#### Node 18

```json
Expand Down