From the course: TypeScript for Node.js Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
TypeScript file conventions
From the course: TypeScript for Node.js Developers
TypeScript file conventions
- [Instructor] As you saw on the previous video it is very easy to create a TypeScript file and then convert it through a TypeScript command. Any JavaScript file could easily be converted to TypeScript without changing much, and then you immediately get all the benefits of using TypeScript and JavaScript all together. Now, let's convert a project and let me demonstrate how easy it is to start using TypeScript, out of the box with a simple extension change. So, we can delete the test files if we want, so let's go ahead and delete those. Bin then yes. And what we're going to do is take a look at every file that has the js extension and then change it to ts and that's all it needs to actually change all these files into a TypeScript compatible file. So let's go ahead and change this one, so rename, and then do ts and then do the same for the routes. Model, and then finally, the controllers. Perfect. And as you can see, we already have an error from this particular file here, so let's…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.