Options (3)
-t, --targetbooleanCompile a TypeScript file into JavaScript using a specific target syntax (default is `ES3`)
tsc {{[-t|--target]}} {{ES5|ES2015|ES2016|ES2017|ES2018|ESNEXT|...}} {{path/to/file.ts}}-b, --buildbooleanCompile all `.ts` files of a TypeScript project defined in a `tsconfig.json` file (`--build` can be omitted to build the project in the current working directory)
tsc {{[-b|--build]}} {{path/to/tsconfig.json}}-w, --watchbooleanRun the compiler in watch mode, which automatically recompiles code when it changes
tsc {{[-w|--watch]}}Examples (8)
Initialize a TypeScript project
tsc --initCompile a TypeScript file into a JavaScript file with the same name
tsc path/to/file.tsCompile a TypeScript file into JavaScript using a specific target syntax (default is `ES3`)
tsc [-t|--target] ES5|ES2015|ES2016|ES2017|ES2018|ESNEXT|... path/to/file.tsCompile a TypeScript file into a JavaScript file with a custom name
tsc --outFile path/to/output_file.js path/to/input_file.tsCompile all `.ts` files of a TypeScript project defined in a `tsconfig.json` file (`--build` can be omitted to build the project in the current working directory)
tsc [-b|--build] path/to/tsconfig.jsonRun the compiler using command-line options and arguments fetched from a text file
tsc @args.txtType-check multiple JavaScript files, and output only the errors
tsc --allowJs --checkJs --noEmit src/**/*.jsRun the compiler in watch mode, which automatically recompiles code when it changes
tsc [-w|--watch]