Setting up TypeScript

The TypeScript setup depends on the context where it will be used. This is because you can integrate it in any JavaScript tools, libraries, and frameworks as long as it's properly configured for the environment. For now, we will focus on the simplest and the most basic setup.

A basic knowledge of Node and its package manager npm is required to get going with TypeScript. It's also required that you install both from the Node website (https://nodejs.org/en/). 

With Node and npm installed, you can install TypeScript globally using npm via the command line tool:

npm install -g typescript

If you get a permission warning while trying to install, you can use the sudo command:

sudo npm install -g typescript

You will see the ...

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.