Book Image

Introduction to TypeScript [Video]

By : Kamran Ayub
Book Image

Introduction to TypeScript [Video]

By: Kamran Ayub

Overview of this book

<p>TypeScript is a superset of JavaScript that features a robust static type system to help build large-scale applications that are refactor-friendly, maintainable, and scalable. Take advantage of dozens of features from the next generations of JavaScript such as ES2015 and ES2016 without introducing a complex workflow to your project.</p> <p>This course will guide you from a beginner’s level knowledge in JavaScript to being able to successfully start creating applications in TypeScript. You’ll learn why TypeScript’s tooling gives it a heavy advantage over other languages and see how JavaScript works underneath.</p> <p>The course begins with an introduction bringing you up-to-date on the state of the JavaScript ecosystem, where TypeScript fits into it, and why you’d want to leverage it. Then we move onto the basics of TypeScript such as setting up your development environment and learning basic language features by building a simple utility application and extending it with more features. Finally, we explore some practical use cases, such as converting plain-old JavaScript to TypeScript and you’ll see how we tackle any issues faced such as external library references, dynamic typing, and more.</p> <p>By the end of the course, the viewer will be equipped to explain why TypeScript is advantageous for you and your team while also having a foundational knowledge of language features such as the type system, classes, interfaces, modules, and generics.</p> <h1>Style and Approach</h1> <p>This course contains in-depth content balanced with tutorials that put theory into practice. The focus is on giving you both the understanding and the practical examples that will allow you indulge in the art of coding in TypeScript.</p>
Table of Contents (10 chapters)
Chapter 6
Refactoring Our Application with Confidence
Content Locked
Section 1
Choosing the Right Encoder with Options
A more robust application would accept arguments passed in from the command-line; so we will leverage the minimist npm module to add support, but we will also want to ensure only a small part of the code depends on minimist. - Install and use minimist to parse command-line arguments - Use a class to encapsulate handling options - Decouple the dependency on minimist by leveraging type intersection