TypeScript code in a JavaScript environment to learn the language's features and syntax. Course for C-11.
-
npx tsc
install Typescript -
tsc -h
Show all the commands we can use. -
tsc
Compiles the current project into JavaScript. -
tsc --init
The-init
initialize a TypeScript project. It creates atsconfig.json
file in the current directory, which is a configuration file that tells the TypeScript compiler how to compile your TypeScript code.
This is a configuration file for the TypeScript compiler. It specifies the root files and the compiler options required to compile the project. The presence of a tsconfig.json file in a directory indicates that the directory is the root of a TypeScript project.
-
"rootDir": "./src"
Complies src directory -
"outDir": "./build"
Specify an output folder for all emitted files. */ -
type
tsc
to comlpile, then it'll generate a .js file.
- Either starts with an
I
orT