Run Typescript project!

Mehran
Sep 3, 2021

I have often been asked how I can run my Typescript project without converting it to vanilla javascript.

For sure, this is not something new, and there are many engineers already doing this, but since there are still many that don’t know how to do it, I decided to write a concise post about it to put two simple steps together.

Step one:

Install npm package ts-node

npm i ts-node -g

Run the Typescript file:

ts-node src/server.ts

Step two:

While step one is good enough to run your project but you might want to restart your project if there is a change in any file. To do that, you have to install the nodemon package. nodemon works perfectly on the Typescript project if you already installed ts-node beforehand.

Install npm package nodemon

npm i nodemon

Run the Typescript file:

nodemon src/server.ts

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Mehran
Mehran

Written by Mehran

Tech Team Lead | Cloud, Video & Microservices Expert | Insights on streaming innovations & programming. #ContinuousLearning

No responses yet

Write a response