TypeScript
TypeScript compiler commands for type checking, building, and configuring projects with strict type safety.
64 commands
Browse by Topic
Getting Started
Quick setup and installation
Compile
Compilation commands
Config
Configuration & setup
Type Check
Type checking
Declarations
Declaration files
Build
Project references & build
ts-node
ts-node execution
tsx
tsx runtime
Diagnostics
Performance & analysis
Install TypeScript globally
Install the TypeScript compiler globally via npm
Check TypeScript version
Verify TypeScript installation and display compiler version
Initialize TypeScript config
Generate a tsconfig.json file with default compiler options
Compile project
Compile project using tsconfig.json in current directory.
Compile specific file
Compile a single TypeScript file to JavaScript.
Watch mode
Compile and automatically recompile on file changes.
Compile with output directory
Redirect compiled output to specific directory.
Compile to single file
Concatenate output to single file (AMD/System modules only).
Use specific config
Compile using a specific tsconfig file.
Target ES version
Set ECMAScript target version (ES5, ES6, ES2020, ES2022, ESNext).
Set module system
Specify module system (CommonJS, ES2015, ESNext, NodeNext).
Generate source maps
Generate .js.map files for debugging.
Stop on error
Don't emit JavaScript if type errors are found.
Initialize tsconfig
Create tsconfig.json with default settings.
Show effective config
Display effective configuration after extending base configs.
List compiled files
Print names of all files included in compilation.
Show compilation diagnostics
Show detailed performance diagnostics.
Trace module resolution
Show detailed module resolution process for debugging.
Set module resolution
Specify resolution strategy (NodeNext, node16, bundler).
Type check only
Validate types without generating JavaScript files.
Type check in watch mode
Continuous type checking in background.
Enable strict mode
Type check with all strict options enabled.
Check null/undefined
Treat null and undefined as distinct types.
Check implicit any
Error on expressions with implied 'any' type.
Check unused locals
Error on unused variables and parameters.
Incremental type checking
Fast type-check only with incremental compilation cache.
Clean watch output
Preserve console output in watch mode instead of clearing screen.
Custom build info file
Specify custom location for incremental compilation cache file.
Skip library checks
Skip type checking of all declaration files (*.d.ts) for faster builds.
Optimize rebuild speed
Assume file changes only affect direct imports (faster, less safe).
Incremental with cache
Full incremental compilation with custom cache directory.
Generate declaration files
Generate .d.ts files alongside JavaScript output.
Declarations only
Generate only .d.ts files (no JavaScript).
With declaration maps
Generate source maps for .d.ts files (enables Go to Definition).
Library build setup
Full library build with JS, types, and source maps.
Build project references
Build project with all referenced projects in correct order.
Build with watch
Build mode with continuous watching for changes.
Clean build outputs
Delete all output files from referenced projects.
Force rebuild
Rebuild all projects regardless of up-to-date status.
Dry run build
Show what would be built without actually building.
Verbose build output
Show detailed logging during multi-project build.
Incremental project build
Build project references with incremental compilation for faster rebuilds.
Build multiple projects
Build multiple project configs simultaneously (monorepo pattern).
Preview build plan
Show detailed build plan without executing (useful for debugging).
Enable composite mode
Enable constraints for project references (required for --build).
Run TypeScript file
Execute TypeScript file directly without precompilation.
Start REPL
Start interactive TypeScript REPL.
Evaluate code
Evaluate TypeScript code from command line.
Transpile only (fast)
Skip type checking for faster execution.
ES modules mode
Run with ES modules support.
With specific config
Use specific tsconfig for execution.
Register hook (Node.js)
Run TypeScript via Node.js with ts-node as loader.
Run with tsx
Execute TypeScript with near-instant compilation (~20ms).
tsx watch mode
Auto-restart on file changes (built-in hot reload).
tsx with ignore paths
Watch mode excluding specific directories.
tsx REPL
Start fast interactive TypeScript REPL.
tsx with Node flags
Pass Node.js flags through (debugging, env, etc.).
tsx with env file
Load environment variables from file.
Development workflow
Parallel type checking and execution (recommended).
List files only
List all files that would be compiled without actually compiling.
Explain file inclusion
Show detailed reasons why each file is part of the compilation.
Generate performance trace
Create performance trace directory for analyzing slow compilation.
Show compilation stats
Display compilation time and memory usage statistics.
Generate CPU profile
Create CPU profile for deep performance analysis (Chrome DevTools compatible).
Discussion
Loading comments...