Note to self: You started using Replit instead: https://replit.com/@JanacMeena/Janacs-Typescript, since it was simpler to run the code. However, it might be worthwhile figuring out how to setup a simple test repo offline, so I can use github copilot.
This repo tracks my progress with learning Typescript, and related technologies, including:
- Typescript
- Date library
- Jest tests
- NodeJS
- Built in WebStorm
- React Router
- Typescript Open API Standard - TOAS
- TSyringe - DI Framework
- ExpressJS
- Yarn
- Nodemon
I started this repo May 11th 2021. Since then, NextJS has exploded in popularity, and ExpressJS is decreasing in popularity. I plan on continuing my experiments in a new repo: https://github.com/janacm/nextjs/
- Install ts-node
# Locally in your project.
npm install -D typescript
npm install -D ts-node
# Or globally with TypeScript.
npm install -g typescript
npm install -g ts-node
We use jest
for tests. Run jest.test.ts
. via WebStorm.
- Run
tsc
- This will compile and output the Typescript files as JS into
./out
.
- This will compile and output the Typescript files as JS into
- Run
node out/app.js
- This starts the application
- Run VSCode debugger, specifying
launch.json
- Open a JavaScript Debug Terminal
- Run
node out/app.js
yarn test
- Filename must end with
.test.ts
- Run
tsc
after file creation