0Pricing
TypeScript Academy · Lesson

@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/node

All lessons in this course

  1. @types/node, ESM vs CJS in Node
  2. Runtime options (ts-node/tsx) & sourcemaps
← Back to TypeScript Academy