- Typescript is a superset of javascript. It has matured a lot since its inception.
- It helps a developer to write clean javscript code
- In addition to javascript typescript has some additional features like Enums, Tuples, Types, etc.
- similar to Java where method args can be declared with datatypes TS allows the same feature
- Implicit typing is allowed. TS assumes based on the code and does the implicit typing
Typescript is like a developer tool that notifies the developer about code smells End of the day - TS transpiles the ts file into javascript file
$ tsc XXXX.ts
compiles and generates the js file
$ node XXXX.js
executes the compiled js file
$ tsc XXXX.ts --watch
will automatically compile the changes when a file is modified
a package.json file is present with the task start. the 'start' task executes the typescript compilation and runs the index.js file
$ npm start