Member-only story
How to set up a Node 16, Express & Typescript API
4 min readOct 20, 2021
I’ve been working on changing up one of my python projects to typescript and it surprises me that in 2021 there isn’t a CLI tool or script that can set this up for you already. You can tell I’m from the frontend world 😃
Anyway, I’ve put this article together to help others who want to do the same and use the latest build tools to do so.
Explanation video 📹
Note: The steps below are quite brief, if you want more of an explanation watch the video.
Install Packages 🎁
- Create a new directory
mkdir <my-awesome-project>
cd
into that directory and initialise npm with all the defaultsnpm init -y
- Install Express
npm i express
- Install Typescript with the express and node types
npm i typescript @types/express @types/node -D
- We’re going to use SWC to transpile the TS to JS for prod so install all of these things
npm i @swc/cli @swc/core -D
- We’re going to use Nodemon to watch the dev environment, you can install it with
npm i nodemon -D