TypeORM is an ORM that has gain a lot of attention. The native integration with TypeScript enables developers to effectively integrate TypeORM into their TypeScript project. In this tutorial, I will be covering CRUD functions/APIs in Express.js (Node.js). No front-end is required in this tutorial as we will be using swagger to test our APIs.
In this tutorial, you will learn to setup Express + TypeScript application in Node.js, mainly for backend purpose. One of the most common backend services are CRUD (Create, Read, Update, Delete) services. These services require data persistence, as such, it is essential for the Express app to be able to perform these function effectively and efficiently. After experiencing and comparing different ORM libraries such as Sequelize, Prisma, and LoopBack, I have decided to settle down with TypeORM. One of the main reasons I love TypeORM is the seamless integration with TypeScript and TSOA (TypeScript Open APIs) library as it is using decorator designs.
To get started, we will use create-express-typescript-application library to generate well-structured express application.
Before running create-express-typescript-application command, please make sure you have the following packages installed in your local machine. They are npm, node and git.
#typescript #expressjs #nodejs #javascript