tsc
tsc is a command line tool used for TypeScript compilation. It stands for "TypeScript Compiler" and is built by the TypeScript team. The primary purpose of tsc is to convert TypeScript code into JavaScript code, since browsers and runtime environments generally understand only JavaScript. It supports the latest JavaScript features and provides a way to write and develop JavaScript applications using TypeScript's static typing feature. tsc takes TypeScript files (.ts or .tsx) as input and transpiles them into JavaScript files (.js). It offers various compilation options for controlling the output, such as specifying the target ECMAScript version, generating source maps, optimizing code, and more. The tool also supports incremental compilation, which speeds up subsequent compilation runs by only recompiling modified files. tsc can be configured by using a tsconfig.json file, allowing for project-specific compilation settings and fine-grained control over the compilation process. It integrates well with build systems and can be easily incorporated into workflows using tools like npm scripts, webpack, or other build automation tools. The TypeScript team regularly updates tsc with new features, bug fixes, and performance improvements, ensuring compatibility with the latest TypeScript language specifications. Overall, tsc is a versatile and powerful command line tool that enables developers to easily compile and transpile TypeScript code into JavaScript, facilitating the development of scalable and maintainable JavaScript applications.
List of commands for tsc:
-
tsc:tldr:1e610 tsc: Compile a TypeScript file into a JavaScript file with a custom name.$ tsc --outFile ${output-js} ${input-ts}try on your machineexplain this command
-
tsc:tldr:3577c tsc: Type-check multiple JavaScript files, and output only the errors.$ tsc --allowJs --checkJs --noEmit ${src-**-*-js}try on your machineexplain this command
-
tsc:tldr:72b45 tsc: Compile a TypeScript file into JavaScript using a specific target syntax (default is `ES3`).$ tsc --target ${select} ${foobar-ts}try on your machineexplain this command
-
tsc:tldr:b7ea0 tsc: Compile all `.ts` files of a TypeScript project defined in a `tsconfig.json` file.$ tsc --build ${tsconfig-json}try on your machineexplain this command
-
tsc:tldr:b90f6 tsc: Run the compiler using command-line options and arguments fetched from a text file.$ tsc @${args-txt}try on your machineexplain this command
-
tsc:tldr:cd127 tsc: Compile a TypeScript file `foobar.ts` into a JavaScript file `foobar.js`.$ tsc ${foobar-ts}try on your machineexplain this command