25 articles
Knowledge Base
Node.js
25 articles in the Node.js category · page 1 of 2.
- WebSocket scaling patterns for Node.js Scale a Node.js WebSocket service across several machines so broadcasts and presence keep working when a second box joins. You will set up sticky Nginx routing, the Socket.IO Redis adapter and Redis-backed presence.
- npm vs pnpm vs Yarn — choosing a Node.js package manager Compare npm vs pnpm vs Yarn and pick the Node.js package manager that fits your project. pnpm suits monorepos and busy CI pipelines, npm is the lowest-friction default, and Yarn Berry fits teams ready to adopt Plug'n'Play.
- Fastify vs Express in production Compare Fastify vs Express for production Node.js HTTP services using measurements from a real workload instead of a hello-world benchmark. You will see when each framework is the better pick, based on your validation strategy, your ecosystem and the cost of migrating.
- Node.js supply-chain security with LavaMoat and SES Learn how to protect a Node.js project from malicious npm packages that vulnerability scanners miss. You will switch off install scripts by default, lock down each dependency with LavaMoat, and see where SES runtime isolation fits.
- NestJS microservices transports — Redis, NATS, RabbitMQ, gRPC Learn how to pick the right NestJS microservices transport for your workload and configure it for production. This guide compares Redis, NATS, RabbitMQ, Kafka, and gRPC on message loss, ordering, and acknowledgements, so you can choose with your eyes open.
- Deno vs Node.js for production workloads This guide compares Deno and Node.js for teams deciding which JavaScript runtime to run in production. You will learn where Deno helps, where Node.js is the safer choice, and how to tell which one fits your project.
- Setup Node.js App in cPanel: Node.js Selector and Passenger, step by step Set up a Node.js app in cPanel with the Setup Node.js App tool, which is CloudLinux's Node.js Selector running your code behind Phusion Passenger. You will create the application, install dependencies inside its own environment, set environment variables, restart it from the shell, and prove that the running process is the one answering your URL.
- Prisma migrations in production Learn how to apply Prisma migrations in production against a live Postgres or MySQL database without downtime or lost data. You will set up a deploy step that applies migrations safely, catch schema drift early, and ship column changes that survive a rolling deploy.
- Bun runtime vs Node.js: which one should carry your service? Bun is faster at start-up, installs, bundling and testing. Node has the LTS cadence, the native-addon story and the operations tooling. How to decide, and how to test compatibility against your own dependency tree.
- Node.js built-in test runner: node --test without a framework Use the Node.js built-in test runner instead of adding a test framework: node --test file discovery, node:assert/strict, subtests, hooks, t.mock, watch mode, coverage, and JUnit output for CI.
- PM2 process management for Node.js in production Run Node.js services under PM2 with cluster mode, log rotation, and systemd-managed startup so a single host survives crashes, deploys, and reboots.
- Debugging production Node.js with Chrome DevTools Attach Chrome DevTools to a running Node.js process over an SSH tunnel to inspect heap, CPU, and live state without restarting the service.
- Caching static assets and proxy responses with Nginx in front of Node.js Put Nginx in front of Node.js for static-asset serving, proxy response caching, and offloading TLS — with cache-control discipline that matches your app.
- Hunting memory leaks in Node.js with heap snapshots Take, diff, and analyze V8 heap snapshots to pin down which closures, listeners, or caches are holding memory in a long-running Node.js service.
- Deploying NestJS to production Compile, package, configure, and run a NestJS application in production with proper logging, graceful shutdown, and process supervision.
- TypeORM migrations in production Generate, apply, and roll back TypeORM migrations against a production database with confidence: CLI workflow, transactions, and synchronize: false discipline.
- Node.js cluster mode with sticky load balancing Scale a single-process Node.js service across CPU cores using cluster, and route socket-stateful traffic to the same worker every time.
- npm audit and Snyk for Node.js dependency vulnerability scanning Wire npm audit, Snyk, and lockfile review into a Node.js CI pipeline so vulnerable dependencies are caught before they ship.
- PM2 cluster mode, watchdog, and respawn Run Node.js services under PM2 with cluster scaling, automatic respawn, memory-threshold restarts, and the operational details that keep PM2 honest.
- Installing Node.js with nvm on Ubuntu and Debian Install and pin Node.js versions per project with nvm, then convert the developer workflow into something predictable on a production host.
- Worker threads for CPU-bound work in Node.js Push CPU-bound work off the main event loop with the worker_threads module so HTTP handlers stay responsive under load.
- Hardening Express with Helmet, rate limit, and CORS Add the security middleware stack — Helmet, express-rate-limit, CORS, body limits, slow loris protection — that every production Express service should have.
- Nginx as a reverse proxy for Node.js Front a Node.js service with Nginx on Ubuntu — listen on 443 with Let's Encrypt, hand off to upstream Node on 127.0.0.1, and get WebSocket and timeout settings right.
- Sequelize migrations in production Run sequelize-cli migrations against a live production database with rollback safety, multi-environment configs, and the seed/migration separation that matters.