- Initialize package.json
npm init --yes
- Install TypeScript
npm install --save-dev typescript
- Install ts-node
npm install --save-dev ts-node
You can install all the packages for all the projects up front, saving you time in the future. To do so, from this directory:
npm i
npm run install-all
We can use ts-node to run the file directly by running the following command:
npx ts-node app.ts