23 articles
Knowledge Base
Node.js
23 articles in the Node.js category.
- 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.
- Prisma migrations in production Apply Prisma schema migrations safely against live Postgres or MySQL: deploy vs reset, baselining, drift detection, and rolling-deploy compatibility.
- 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.
- Deno vs Node.js for production workloads Comparing Deno 2.x against Node.js: permissions model, npm compatibility, standard library, deployment, and where Deno is the right choice.
- Deploying NestJS to production Compile, package, configure, and run a NestJS application in production with proper logging, graceful shutdown, and process supervision.
- NestJS microservices transports — Redis, NATS, RabbitMQ, gRPC How to pick and configure a NestJS microservice transport for production: tradeoffs of Redis pub/sub, NATS, RabbitMQ, Kafka, and gRPC.
- Fastify vs Express in production Practical comparison of Fastify and Express for production Node.js HTTP services: throughput, ecosystem, JSON schema, middleware compatibility, migration cost.
- TypeORM migrations in production Generate, apply, and roll back TypeORM migrations against a production database with confidence: CLI workflow, transactions, and synchronize: false discipline.
- WebSocket scaling patterns for Node.js Scale Node.js WebSocket services beyond one box: sticky load balancing, Redis pub/sub adapter, presence, and the connection-budget math that matters.
- Node.js supply-chain security with LavaMoat and SES Defend against malicious npm packages: lifecycle script policy, dependency hardening with LavaMoat, runtime isolation with SES, and the layers below dependency scanning.
- 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.
- npm vs pnpm vs Yarn — choosing a Node.js package manager Decision framework for npm, pnpm, and Yarn in production: disk layout, install speed, workspaces, lockfile compatibility, and the operational tradeoffs that matter.
- 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.
- Continuous V8 profiling for Node.js with pprof Capture flame graphs from production Node.js services on a schedule using the pprof format and a sampling profiler that adds minimal overhead.
- Bun vs Node.js for production workloads Where Bun is genuinely faster than Node, where the ecosystem gap still matters, and what to verify before betting a production service on it.