How it works...
The TypeScript compiler is a JavaScript cross-compiler that will convert TypeScript files with *.ts to a normal *.js version. This allows us to take advantage of new language features, such as strict type checking, variable scoping, and many other enhancements, while still reliably ending up with code that will run in any Node.js environment.
Since the TypeScript language is a superset language of ES6 JavaScript, we can mix the two freely in our project as necessary. While it would be optimal to convert our entire Node.js project using TypeScript, sometimes large project code bases or time limitations make it more convenient to convert portions of a project to TypeScript over time. This works wonderfully in TypeScript through ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access