The npm ecosystem has over two million packages — most of which you should never install. We've tested these libraries across real client projects at GEXP Software. These are the ones that earn their place in package.json and don't become regrets six months later.
01Web Frameworks & HTTP
Server frameworks and HTTP libraries for building APIs and web applications with Node.js.
Hono
open-sourceAn ultrafast web framework that runs everywhere — Node.js, Deno, Bun, Cloudflare Workers, and Lambda. The middleware API is clean, TypeScript support is excellent, and it benchmarks faster than Express by orders of magnitude. Our default for new API projects.
Runs on Node, Bun, Deno, and every edge runtime with one codebase
Fastify
open-sourceA high-performance Node.js framework with a powerful plugin architecture and built-in schema validation via JSON Schema. Significantly faster than Express with better developer ergonomics. The plugin system takes time to learn but scales beautifully.
JSON Schema validation built in for requests and responses
Express
open-sourceThe original Node.js web framework that defined the ecosystem. Massive middleware catalog and every tutorial uses it. Still works fine for simple projects, but the lack of built-in TypeScript support and async error handling shows its age.
Largest middleware ecosystem in the Node.js world
tRPC
open-sourceEnd-to-end type-safe APIs without code generation. Define your API on the server and get full TypeScript autocomplete on the client. Eliminates the REST vs GraphQL debate for full-stack TypeScript projects. Only works when you control both ends.
Full-stack type safety without any code generation step
Elysia
open-sourceA Bun-first web framework with end-to-end type safety, validation, and excellent performance. The plugin ecosystem is growing fast. Primarily designed for Bun, so Node.js support is secondary. Excellent if you've committed to the Bun runtime.
End-to-end type safety optimized for the Bun runtime
Nitro
open-sourceThe server engine behind Nuxt that works standalone for building universal server apps. Deploys to any platform with automatic adapters. File-based routing for API endpoints, built-in caching, and storage abstraction. Less known but exceptionally well-designed.
Universal server engine that auto-adapts to any deployment platform
02Database & ORM
Libraries for connecting to databases, managing schemas, and querying data from Node.js applications.
Drizzle ORM
open-sourceA TypeScript ORM that generates SQL you can read. The query builder feels like writing SQL with type safety, and the schema-as-code approach makes migrations predictable. Lighter than Prisma with better SQL transparency. Our ORM of choice for new projects.
Type-safe SQL queries that look and perform like hand-written SQL
Prisma
open-sourceThe most popular TypeScript ORM with a schema-first approach, auto-generated client, and excellent migration tooling. Prisma Studio provides a visual database browser. The generated queries can be inefficient for complex joins, and the schema language is its own DSL to learn.
Auto-generated client with visual database browser (Prisma Studio)
Kysely
open-sourceA type-safe SQL query builder that doesn't hide the SQL — it helps you write it correctly. Zero runtime overhead and the TypeScript inference catches column name typos at compile time. Perfect for teams that want control over their queries without an ORM's abstractions.
Type-safe SQL queries with zero runtime overhead
Redis (ioredis)
open-sourceThe most robust Redis client for Node.js with cluster support, Lua scripting, and automatic reconnection. Handles Redis Sentinel and Redis Cluster transparently. Essential for caching, sessions, and pub/sub. The API mirrors Redis commands closely.
Transparent Redis Cluster and Sentinel support
Mongoose
open-sourceThe dominant ODM for MongoDB with schema validation, middleware hooks, and population for document references. Mature and battle-tested. The abstraction over MongoDB's native driver adds overhead and the schema validation doesn't replace server-side validation.
Battle-tested MongoDB ODM with middleware hooks and population
Knex.js
open-sourceA SQL query builder supporting PostgreSQL, MySQL, SQLite, and MSSQL with a migration system and seeding. More flexible than ORMs for complex queries while still providing parameterized queries. TypeScript support is workable but not as tight as Kysely or Drizzle.
03Validation & Schema
Libraries for validating data, defining schemas, and ensuring type safety at runtime.
Zod
open-sourceTypeScript-first schema validation that infers types from your schemas. Define once, validate at runtime, and get compile-time types for free. The ecosystem of Zod-based tools (form libraries, API validators, env checkers) is massive. Our default validation library.
Define a schema once — get runtime validation and TypeScript types
Valibot
open-sourceA modular validation library that's significantly smaller than Zod due to its tree-shakeable architecture. Same concept as Zod but each validator is an independent function. Bundle size matters for edge and client-side use cases where Valibot shines.
90% smaller than Zod with tree-shakeable validators
TypeBox
open-sourceJSON Schema builder with TypeScript type inference. Validates data using standard JSON Schema (via Ajv) while giving you TypeScript types. Fastest runtime validation in the ecosystem because it compiles to native JSON Schema validation.
Fastest runtime validation — compiles to native JSON Schema
ArkType
open-sourceRuntime validation using TypeScript syntax directly — you write types as strings and get both runtime validation and compile-time types. The syntax feels native to TypeScript developers. Newer and less ecosystem support than Zod, but the API is elegant.
Write validation schemas using TypeScript syntax directly
Ajv
open-sourceThe fastest JSON Schema validator in JavaScript, used internally by Fastify and hundreds of other libraries. Compiles schemas to optimized validation functions. Essential when you need standards-compliant JSON Schema validation. The API is less ergonomic than Zod for TypeScript projects.
class-validator
open-sourceDecorator-based validation for TypeScript classes, commonly used with NestJS. Validates class instances using decorators like @IsEmail, @MinLength, etc. Tightly coupled to the decorator pattern — if you're not using classes, Zod or Valibot are better fits.
04Authentication & Security
Libraries for handling authentication, authorization, encryption, and security in Node.js applications.
better-auth
open-sourceA modern authentication library for Node.js with built-in support for email/password, OAuth, magic links, and multi-factor auth. Framework-agnostic with adapters for popular ORMs. Well-designed API that avoids the complexity of rolling your own auth.
Complete auth system with MFA, OAuth, and magic links out of the box
Lucia
open-sourceA lightweight auth library focused on session management that works with any database. Gives you the building blocks for auth without the opinions of a full auth platform. Requires more manual work than better-auth but gives you more control over every detail.
Lightweight session management that works with any database
jose
open-sourceA comprehensive JWT, JWE, JWK, and JWS implementation that works in Node.js, browsers, Deno, and edge runtimes. The API is well-designed and covers every JOSE specification. The go-to library when you need JWT handling without a full auth framework.
Complete JOSE implementation that works on every runtime
Passport
open-sourceThe classic authentication middleware for Express with 500+ strategies for every OAuth provider. Still widely used but showing its age — callback-based API, no built-in TypeScript types, and the strategy ecosystem has inconsistent quality.
500+ authentication strategies for every OAuth provider
helmet
open-sourceSets security-related HTTP headers (CSP, HSTS, X-Frame-Options, etc.) with sensible defaults. One line of middleware that fixes the most common security header misconfigurations. Not a complete security solution, but it covers the low-hanging fruit.
One line of middleware that fixes the most common security headers
rate-limiter-flexible
open-sourceA mature rate limiting library supporting Redis, Memcached, MongoDB, and in-memory backends. Handles sliding windows, token buckets, and burst protection. More flexible than express-rate-limit with better distributed system support.
05Utilities & Developer Experience
General-purpose libraries that improve code quality, error handling, and development workflow.
date-fns
open-sourceModular date utility library with tree-shakeable functions — only import what you use. Covers formatting, parsing, comparison, and manipulation. Immutable by design, unlike Moment.js. The function-based API is cleaner than Luxon's class-based approach for most use cases.
Tree-shakeable date utilities — import only what you use
pino
open-sourceThe fastest Node.js logger with structured JSON output by default. Low overhead that won't slow down your production server. The transport system handles log routing without blocking the event loop. Our logging library for every Node.js project.
Fastest Node.js logger — 5x faster than Winston
dotenv
open-sourceLoads environment variables from .env files into process.env. Simple and universal. Every Node.js developer knows it. For type-safe env handling, pair it with Zod or T3 Env — dotenv alone doesn't validate or type-check your variables.
nanoid
open-sourceA tiny, URL-friendly unique ID generator that's more compact and faster than UUID. Generates IDs like 'V1StGXR8_Z5jdHi6B-myT' in 130 bytes. Cryptographically secure by default. When you don't need UUID compliance, nanoid is the better choice.
URL-friendly unique IDs in 130 bytes, faster than UUID
tsx
open-sourceRun TypeScript files directly in Node.js without a compilation step. Replaces ts-node with faster execution and better ESM support. The watch mode is excellent for development. Simple, fast, and just works.
Run TypeScript directly in Node.js with zero config
Effect
open-sourceA TypeScript library for building type-safe, composable, and resilient applications. Handles errors, concurrency, retries, and dependency injection in a functional style. Steep learning curve but once adopted, the reliability guarantees are transformative for complex backends.
Typed errors, concurrency, and retries in a functional paradigm
Bull (BullMQ)
open-sourceA Redis-based queue library for Node.js with job scheduling, retries, concurrency control, and a dashboard UI. The most mature job queue in the ecosystem. Handles everything from email sending to data processing pipelines reliably.
Production-ready job queues with scheduling, retries, and a dashboard
p-limit
open-sourceControls concurrency for async operations — run at most N promises at a time. Tiny, focused, and prevents overwhelming APIs or databases with too many parallel requests. Part of the excellent sindresorhus utility ecosystem.