Node.js
A JavaScript runtime built on V8 with an event loop and non-blocking I/O.
Runs servers, CLIs and tooling; its http module is low-level, so frameworks are built on top.
Backend & APIs
Node.js is the JavaScript runtime, Express is a minimal web framework running on it, and NestJS is an opinionated, structured framework that usually runs on top of Express or Fastify.
A JavaScript runtime built on V8 with an event loop and non-blocking I/O.
Runs servers, CLIs and tooling; its http module is low-level, so frameworks are built on top.
A minimal, unopinionated web framework for Node.js.
Routing and middleware with little structure; fast to start, structure is up to you.
A TypeScript-first, opinionated framework for scalable server apps.
Modules, providers, dependency injection, guards and pipes give large teams a consistent architecture.
| Aspect | Node.js | Express | NestJS |
|---|---|---|---|
| Layer | Runtime | Web framework | Application framework |
| Opinionated | No | No | Yes |
| TypeScript | Supported | Optional | First-class |
| Architecture | None | Middleware chain | Modules + DI |
| Best for | Anything server-side | Small APIs, quick services | Large, structured backends |
Node.js is the JavaScript runtime with an event loop and non-blocking I/O. Express is a minimal web framework that runs on Node.js. NestJS is an opinionated, TypeScript-first application framework that usually runs on top of Express or Fastify.
No. Express is a separate npm package built on Node.js's http module, adding routing, middleware and request and response helpers.
Not exactly. NestJS uses Express by default as its HTTP platform (or Fastify), and adds structure on top: modules, controllers, providers, dependency injection, pipes, guards and interceptors.
For small APIs, quick services, prototypes or when you want full control with little structure. It has a tiny core and a huge middleware ecosystem.
For larger backends and teams that benefit from consistent architecture, dependency injection, testability and built-in patterns for validation, auth, microservices and GraphQL.
Express registers routes with app.get or routers in code. NestJS declares routes with decorators such as @Controller('users') and @Get(':id') on controller classes.
NestJS's container creates providers such as services and injects them into constructors based on module configuration. Express has no built-in DI; you pass dependencies manually or add a library.
In Express you add middleware such as Zod, Joi or express-validator. NestJS uses pipes, commonly ValidationPipe with class-validator decorators on DTOs, applied globally or per route.
Express typically uses Passport or custom middleware. NestJS uses guards, often with @nestjs/passport strategies, applied with decorators to controllers or routes.
Express middleware runs in sequence before route handlers. NestJS interceptors wrap handler execution, able to transform results, measure time or cache, with access to the execution context.
Practise every comparison in your dashboard.
Start learning