package.json
manifest for our application to keep track of our dependencies and ensure our project is portable:npm init
and follow the prompts. You can add as much or as little information as you want here. For now, the default options suffice.npm
to install TypeScript as a development dependency:tsc
binary. Create a TypeScript configuration file i called tsconfig.json
n the root of the project. Use the template that follows:rootDir
and outDir
. These options describe where our source .ts
files and our compiled .js
files, respectively, live within our project. Create the directories referenced by the setting values:./src/index.ts
.npx tsc
to compile the project.tsc
program compiled our source TypeScript file into ES6 JavaScript and provided a source map for debugging..ts
files for changes: npx tsc -w