Skip to content
StackPractices

Tag: nodejs

Browse 27 practical software engineering resources tagged with "nodejs". Discover code recipes, design patterns, documentation templates, and in-depth guides to help you build, deploy, and maintain production-ready solutions involving nodejs.

Express.js Middleware Composition Patterns

Build maintainable Express applications using middleware composition patterns for authentication, validation, error handling, request context propagation, and async route wrappers

Build a GraphQL API with Apollo Server and TypeScript

How to build a production-ready GraphQL API using Apollo Server, TypeScript, and DataLoader to solve the N+1 query problem

Server-Sent Events with Node.js and Express

Implement real-time server-to-client push using Server-Sent Events in Node.js with Express, covering connection management, event types, reconnection logic, and backpressure handling

Build a Bidirectional Chat with WebSocket and Node.js

How to build a real-time bidirectional chat application using WebSocket with room-based messaging, presence tracking, and message persistence

Node.js JWT Authentication: Verify and Refresh Tokens

Implement JWT authentication in Node.js with access and refresh tokens

Node.js OAuth2 GitHub Login with Express

Implement GitHub OAuth2 login flow in Node.js with Express and Passport

Implement an LRU Cache in Node.js

Build a least-recently-used cache in Node.js with O(1) get and set operations using a Map-based doubly linked list

Implement Redis Cache Invalidation in Node.js

Invalidate Redis cache entries in Node.js with TTL expiry, explicit deletion, pattern-based clearing, and pub/sub-based distributed invalidation.

Merge JSON Files in JavaScript

Combine multiple JSON files with conflict resolution strategies using Node.js.

CRUD Operations with MongoDB and Mongoose

How to perform Create, Read, Update, and Delete operations in MongoDB using Mongoose ODM with Node.js and Express

Node.js Caching with Redis: Cache-Aside and TTL Patterns

Cache API responses in Node.js with Redis using cache-aside and TTL patterns

Generate Temporary Files

How to create temporary files and directories safely with automatic cleanup across Python, Node.js, Java, and Bash.

Node.js File Upload Validation: Type, Size, and Content

Validate file uploads in Node.js with multer for type, size, and content

Stream Process Large Files in Node.js Without Memory Issues

Process GB-sized files in Node.js using streams. Covers readline, transform streams, pipeline, backpressure, and chunk processing.

Rotate Log Files

How to implement log rotation by size, date, and count to prevent disk exhaustion across Python, Node.js, Java, and Linux systems.

WebSockets for Real-Time Communication

Build bidirectional real-time communication with WebSockets, handling connection management, reconnection, and fallbacks.

High-Performance Logging with pino

How to use pino for fast structured JSON logging in Node.js, including log levels, child loggers, transports, and integration with Express and Fastify.

Error Tracking with Sentry in Express

How to integrate Sentry for error tracking in Node.js Express applications, including error handlers, performance monitoring, release tracking, and source maps.

Rotate Logs Daily with Winston

How to configure daily log rotation in Node.js using winston and winston-daily-rotate-file, including size limits, retention, compression, and transport combining.

Enforce Security Rules in Node.js with

How to configure eslint-plugin-security to detect insecure patterns in Node.js code, handle false positives, and integrate with CI/CD pipelines.

Configure HTTP Security Headers with Helmet in Node.js

Set security HTTP headers in Express apps with Helmet — CSP, HSTS, X-Frame-Options, X-Content-Type-Options, and CORS for OWASP-compliant web security

Password Hashing in Production

Securely hash and verify passwords using bcrypt, scrypt, and Argon2 with what works.

Deploy HTTP Cloud Functions on Google Cloud with Node.js

Create and deploy HTTP-triggered Cloud Functions on Google Cloud with Node.js, Express integration, secrets management, and gcloud CLI deployment.

Test Express APIs with supertest

How to test Express.js REST API endpoints end-to-end using supertest, including status codes, JSON bodies, headers, authentication, and error handling.

Chain of Responsibility for Request Processing Middleware

Pass requests along a chain of handlers where each handler decides whether to process the request or pass it to the next handler in the pipeline

Testcontainers: Real Dependencies in Integration Tests

Master Testcontainers for integration testing with real databases, message brokers, and APIs. Covers Java, Python, and Node.js with Docker-based test fixtures.