Now that you're more familiar with npm, let's add TypeScript to our project. As discussed in the last section, we'll add it to the package.json file and then we will also add a script to invoke it easily.
First, add the devDependencies section and add TypeScript to those dependencies (since TypeScript is a tool and is only necessary at build time):
"devDependencies": {
"typescript": "3.4.4" },
As we've already mentioned before, you can search for npm packages on the official website: https://www.npmjs.com. In the case of TypeScript, the package is located here: https://www.npmjs.com/package/typescript.
Next, replace the scripts section with the following:
"scripts": { "compile": "tsc" },
With this script, we will be able to easily invoke the TypeScript version...