Step by step using Typescript (TS) in Express (Node.js) Project

Said BADAOUI
5 min readJan 9, 2021

In this tutorial, you will learn how to use Typescript(TS) in Express (Node.js) project.

Requirements:

  • Basic knowledge in Typescript (TS), Node.js and Express
  • Having a Node version from v12 upwards, including Node 12.

1. Set up the project

The first step is to create a directory for the project and initialise it. Run the following commands to create an empty directory called express-nodejs-ts, and change the current directory to it:

mkdir express-nodejs-ts
cd express-nodejs-ts

Now that you are in the express-nodejs-ts directory, you have to initialise the Node project. To do so, run the following command:

npm init -y

Using the -y flag in the above command generates the package.json file with the default values. Instead of adding information like the name and description of the project ourselves, npm initialises the file with default values.

The project is initialised, and thus you can move to the next section — adding the project dependencies.

2. Add dependencies

--

--

Said BADAOUI
Said BADAOUI

Written by Said BADAOUI

Full-stack developer & passionate blogger, using technology to bring ideas to life and sharing knowledge through writing. Constantly learning & improving skills