TypeScript 7 cheatsheet
TypeScript 7: Compiler and running
11 common TypeScript 7 tasks.
Install TypeScript
Add the compiler to a project as a development dependency.
npm install --save-dev typescript
Type-check without output
Check types and report errors, writing no files. The usual command in CI.
npx tsc --noEmit
Use another config file
Compile with a specific tsconfig, for example one used only for builds.
npx tsc -p tsconfig.build.json
Show the resolved config
Print the final configuration, with extends and defaults applied.
npx tsc --showConfig
Run a TypeScript file with Node.js
Node.js 24 strips types and runs the file directly. It supports only syntax that erases to JavaScript, so enums and namespaces are not allowed by default.
node app.ts
Run a TypeScript file with tsx
Run TypeScript with a runner that handles more syntax and module settings.
npx tsx app.ts
Install type definitions
Add types for a library that doesn't ship its own.
npm install --save-dev @types/node