Add the package to your "devDependencies"
:
npm install --save-dev @tsconfig/node20
yarn add --dev @tsconfig/node20
Add to your tsconfig.json
:
"extends": "@tsconfig/node20/tsconfig.json"
The tsconfig.json
:
{
"$schema": "https://json.schemastore.org/tsconfig",
"_version": "20.1.0",
"compilerOptions": {
"lib": ["es2023"],
"module": "node16",
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16"
}
}
You can find the code here.