JS & TS FeaturesLesson 38Free preview
Node TypeScript
This lesson is part of Node.js · All levels
Summary
TypeScript can be used directly in Node.js projects via a tsc compiler or a modern loader such as tsx. With static data types, errors such as misnames of properties are caught before the code is executed. The node also supports erasable syntax so that some TS files can be executed directly in the latest version.
Key points
- Install the typescript as devDependency and then create tsconfig.json
- Tsc compiles .ts to .js before running Node
- Tsx or ts-node allows running TS directly during development
- Type helps the IDE provide autocompletion and early bug detection
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.