@types/node, ESM vs CJS in Node
@types/node provides typings for Node APIs, and tsconfig module options let you choose between CommonJS and ESM.
Intro
Goal: Use @types/node for type safety and configure TS for CommonJS vs ES Modules.
Install typings
Install @types/node to get type definitions for built-in Node APIs like fs and path.
npm install --save-dev @types/nodeAll lessons in this course
- @types/node, ESM vs CJS in Node
- Runtime options (ts-node/tsx) & sourcemaps