How to Restart the TypeScript NodeJS Application Fast

How to Restart the TypeScript NodeJS Application Fast

ts-node one of the best tool for NodeJS-Typescript development but when comes to typescript it doesn't do the best job.

I have been working for the different kinds of Node JS application from the last 4 years. For every project I tried to improve the performance and code quality. From that, I found a very interesting way to restart the typescript application so fast.

Introduction

When you are working with Node JS with Typescript you notice a significant delay while restarting the application by using ts-node.

ts-nodeone of the best tool for NodeJS-Typescript development but when comes to typescript it doesn't do the best job.

Typical Typescript NodeJS App

A typical nodejs-typescript 

nodemon.json look like these

{
    "watch" : ["src"],
    "ext" : "ts",
    "exec": "ts-node ./src/app/server.ts"
}

It will work fine but restart speed is too slow.

Don't trust the Server Start time here, it actually took more than 20 seconds to restart.

Trail 1

So I was playing with the nodemon options to make restart faster and found we map our executable with params, so I create this configuration for 

nodemon.json

{
  "env": {
    "NODE_ENV": "development"
  },
  "execMap": {
    "ts": "node --require ts-node/register"
  },
  "ext": "js,json,ts",
  "ignore": [
    ".git",
    "node_modules/**/node_modules"
  ],
  "restartable": "rs",
  "watch": [
    "src/"
  ]
}

typescript nodejs development faster-backend code coding programming nodejs-developer

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire NodeJs Developer

Looking to build dynamic, extensively featured, and full-fledged web applications? **[Hire NodeJs Developer](https://hourlydeveloper.io/hire-dedicated-node-js-developer/ "Hire NodeJs Developer")** to create a real-time, faster, and scalable...

Hire Backend Developers India

Are you looking to hire experienced Backend Developers at a reasonable cost to boost-up your IT business? **[Hire Backend Developers India](https://hourlydeveloper.io/hire-back-end-developer/ "Hire Backend Developers India")** and accomplish...

Hire Dedicated Backend Developers

Want to create a backend for a web or mobile app using PHP & JS frameworks? **[Hire Dedicated Backend Developers](https://hourlydeveloper.io/hire-back-end-developer/ "Hire Dedicated Backend Developers")** who offer end-to-end, robust, scalable...

Hire Nodejs Developer

Looking to **hire NodeJS Developer**[https://www.dataeximit.com/node-js-development/](https://www.dataeximit.com/node-js-development/ "https://www.dataeximit.com/node-js-development/") to build a perfect back-end to your website or...

Top Node.js Development Companies and Expert NodeJS Developers

A thoroughly researched list of top NodeJS development companies with ratings & reviews to help hire the best Node.JS developers who provide development services and solutions across the world. List of Leading Node.js development Service Providers...