What is @tsconfig/node10?
@tsconfig/node10 is a TypeScript configuration preset specifically tailored for Node.js version 10. It provides a set of default TypeScript compiler options that are optimized for developing Node.js applications using TypeScript.
What are @tsconfig/node10's main functionalities?
TypeScript Configuration Preset
This feature allows you to extend the default TypeScript configuration for Node.js 10 by simply referencing the preset in your `tsconfig.json` file. This helps in setting up a TypeScript project quickly with sensible defaults for Node.js 10.
{
"extends": "@tsconfig/node10/tsconfig.json"
}
Node.js 10 Compatibility
The configuration ensures compatibility with Node.js 10 by setting the appropriate ECMAScript version and module system. This helps in leveraging the features available in Node.js 10 while maintaining compatibility.
{
"compilerOptions": {
"lib": ["es2018"],
"module": "commonjs",
"target": "es2018"
}
}
Other packages similar to @tsconfig/node10
@tsconfig/node12
@tsconfig/node12 is similar to @tsconfig/node10 but is tailored for Node.js version 12. It provides a TypeScript configuration preset optimized for Node.js 12, including support for newer ECMAScript features available in that version.
@tsconfig/node14
@tsconfig/node14 is another similar package that provides a TypeScript configuration preset for Node.js version 14. It includes configurations that take advantage of the features and improvements in Node.js 14.
@tsconfig/recommended
@tsconfig/recommended provides a general-purpose TypeScript configuration preset that is not specific to any Node.js version. It offers a set of recommended TypeScript compiler options that can be used for a wide range of projects.
A base TSConfig for working with Node 10.
Add the package to your "devDependencies"
:
npm install --save-dev @tsconfig/node10
yarn add --dev @tsconfig/node10
Add to your tsconfig.json
:
"extends": "@tsconfig/node10/tsconfig.json"
The tsconfig.json
:
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": ["es2018"],
"module": "commonjs",
"target": "es2018",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node"
}
}
You can find the code here.