AJV OpenAPI Schema Validation Middleware
Validate request bodies against JSON Schema compiled with AJV using OpenAPI component schemas, with fast paths and collected error details.
Validate request bodies against JSON Schema compiled with AJV using OpenAPI component schemas, with fast paths and collected error details.
Enqueue background jobs with BullMQ backed by Redis, configure exponential backoff retries, and process them in a worker with failure handling.
Build a git-style CLI with Commander using nested subcommands, variadic arguments, option conflict rules, and typed hook-driven configuration.
Parse CSV as a stream with csv-parse, validate each row against a schema, and pipe valid records onward while collecting row-level errors.
Handle Docker stop signals in Node so in-flight requests drain, background jobs checkpoint, and the process exits within the grace period.
Layer environment configuration from shared defaults through environment-specific files up to process environment with explicit override rules.
Run child processes with execa to get parsed stdout and stderr, shell-free argument arrays, and non-zero exit codes surfaced as typed errors.
Route async failures into Express error middleware with a wrapper, classify status codes, and mask internal details before responding.
Accept streaming multipart uploads in Fastify with per-file size limits, MIME allowlists, and disk writes that never buffer whole files.
Wire Fastify to Pino for structured request logging with redaction, request ids, sampling, and slow-request warnings under load.
Configure the got client to retry transient failures with exponential backoff, status-code allowlists, and per-attempt timeouts for safer polling.
Build interactive CLI flows with Inquirer checkbox prompts, validated input, default selections, and answer-driven branching between steps.
Harden ioredis connections with retry backoff, command timeouts, and sentinel failover so cache clients survive restarts and primary swaps.
Paginate large MongoDB collections with stable cursor queries on indexed compound sort keys, avoiding skipped documents on offset paging.
Group multi-document writes into an atomic MongoDB transaction with a session, abort on validation failure, and retry on transient errors.
Hash passwords with the built-in scrypt using random per-user salts, explicit cost parameters, and timing-safe comparison on verification.
Chain readable, transform, and writable streams with pipeline to process large files in constant memory while propagating backpressure and errors.
Offload CPU-bound work to a pool of worker threads with Piscina-style sizing, transferable buffers, and graceful pool shutdown.
Query PostgreSQL through a pg pool with always-parameterized statements, statement timeouts, idle client recycling, and pool sizing guidance.
Instrument a service with prom-client counters for totals, histograms for latency buckets, and a default metrics endpoint for scraping.
Enforce a distributed rate limit with rate-limiter-flexible backed by Redis points, insurance fallback, and per-key consumption tracking.
Build a Redis-backed caching layer with TTL eviction, LRU maxmemory policy, cache-aside reads, and explicit invalidation on writes.
Enforce least-privilege access with composable role middleware that verifies tokens, resolves roles, and gates routes without inline checks.
Build dynamic IN clauses with generated placeholders instead of string interpolation, keeping every user value bound as a statement parameter.
Speed up static site builds by hashing content inputs per page, reusing unchanged build cache entries, and invalidating only affected pages.
Create an undici Agent with per-origin connection limits and pipelining depth, then dispatch pooled HTTP requests with explicit abort timeouts.
Write Vitest unit tests for an Express app with Supertest, covering success paths, validation errors, and HTTP status assertions per case.
Rotate application logs by day and size with winston-daily-rotate-file, keeping bounded history, zipped archives, and separate error streams.
Parse and validate process.env at boot with a Zod schema so missing or malformed configuration fails fast before any request is served.
Implement JWT authentication flow in Node.js Express with bcrypt password hashing, token signing and verification, refresh token endpoint, and protected.
Build an interactive CLI tool in Node.js using Inquirer for prompts, chalk for colored output, and ora for spinners. Includes command chaining, template.
Handle file uploads in Node.js Express using multer middleware with disk and memory storage strategies, file filtering by MIME type, size limits, and.
Validate form data in Node.js Express using express-validator middleware chains, custom sanitizers, grouped error responses, and conditional validation.