CLI Args Parser With Subcommands
Parse CLI arguments with subcommands flags and positional args using a declarative spec for consistent tooling.
Page 7 of 9
Parse CLI arguments with subcommands flags and positional args using a declarative spec for consistent tooling.
Build a consistent hash ring with virtual nodes for even key distribution and minimal remapping when nodes join or leave.
Configure CORS with explicit origin allowlist credential support and preflight caching for safe cross-origin API access.
Build Content-Security-Policy headers with nonces for inline scripts and strict directives to prevent XSS and data exfiltration.
Parse and transform CSV streams with header mapping type coercion and column selection for data pipelines.
Implement debounce firing on leading edge then trailing edge with cancel and flush for async event streams.
Deep clone objects using structuredClone with fallback for older runtimes handling cycles and typed arrays.
Compare nested objects for deep equality handling arrays dates maps and circular references without stack overflow.
Resolve configuration from defaults file environment and CLI args with explicit precedence and type coercion.
Create a typed event emitter supporting on once off and emit with listener count introspection for decoupled communication.
Evaluate feature flags with user segment rules percentage rollout and dependency checks for safe progressive delivery.
Stream uploaded files to disk with size limit magic byte validation and temp directory cleanup for safe multipart handling.
Validate form fields with composable rule functions that return typed errors and support async dependency checks.
Handle shutdown signals by draining in-flight connections with a timeout before force closing for zero-downtime deploys.
Group array items by a key function and count occurrences for aggregation summaries and frequency analysis.
Implement liveness and readiness probes with dependency checks and timeout for Kubernetes orchestration integration.
Compute HMAC signatures and verify with constant-time comparison to prevent timing attacks on webhook authentication.
Escape HTML special characters and strip dangerous tags from user input to prevent XSS in server-rendered templates.
Parse and verify a JWT signature expiry and custom claims with explicit clock tolerance and audience validation.
Emit structured JSON logs with levels context binding and sampling for production observability without blocking the event loop.
Implement an LRU cache using Map insertion order for O(1) get set and eviction with optional TTL expiry.
Create a memoizing wrapper with LRU cache bounded by max size and per-entry TTL eviction for caching expensive pure functions.
Build a Merkle tree from leaf hashes for tamper-evident integrity verification with efficient root comparison.
Build MongoDB aggregation pipelines with typed stages for filtering grouping and projection.
Parse multipart form data with per-field size limits field count cap and content type validation for safe uploads.
Parse newline-delimited JSON from a stream line by line with error recovery and batch emission for large files.
Safely omit or pick keys from objects returning typed results for immutable data transformation.
Create an observable from DOM events with takeUntil teardown for reactive stream composition and automatic unsubscription.
Resolve file paths within a base directory and reject traversal attempts using dot segments and symlink escape detection.
Use pg Pool for parameterized queries with connection pooling transaction support and error handling.
Implement a binary heap priority queue with push pop and peek supporting custom comparators for scheduling.
Run async tasks through a fixed concurrency pool with backpressure collecting results in order while limiting outstanding promises.
Implement a pub/sub channel with topic subscriptions message filtering and async event delivery for decoupled services.
Implement role-based access control with role hierarchy inheritance and permission resolution for authorization decisions.
Implement a read-write lock allowing concurrent readers or a single writer with upgrade support for shared state.
Create a Node.js Readable stream from an async generator with backpressure and cancellation support.
Acquire distributed locks across multiple Redis instances using the Redlock algorithm with quorum and TTL.
Retry an async function with exponential backoff full jitter and max attempts cap to handle transient errors without thundering herd.
Validate form input with Zod schemas using safeParse for typed error collection and automatic type narrowing.
Deduplicate concurrent identical calls to an async function so only one execution runs and all callers share its result.
Generate 64-bit Snowflake IDs with timestamp worker ID and sequence for sortable numeric unique IDs without coordination.
Build parameterized SQL queries with explicit placeholders to prevent injection while supporting dynamic WHERE and ORDER BY.
Compose Node.js streams with pipe and backpressure handling for memory-efficient data transformation.
Build a fixed-window throttle limiting calls per interval with trailing invocation for bounded request rates.
Cache with time-based invalidation supporting stale-while-revalidate for fresh data with background refresh.
Implement an async token bucket rate limiter that refills tokens at a fixed rate and awaits when empty to enforce sustained throughput.
Generate TOTP codes from a shared secret with time step and digit parameters and verify with window tolerance for clock skew.
Generate RFC 9562 UUIDv7 with Unix timestamp random counter and trailing randomness for time-ordered sortable identifiers.
Implement a WebSocket server with heartbeat ping pong timeout and broadcast for real-time communication.
Cap concurrent async tasks with a promise-based semaphore that queues waiters and releases permits safely.
Propagate a correlation id across async calls with AsyncLocalStorage so every log line carries the request identity.
Parse a single-range HTTP Range header, resolve open ends against a resource size and return a satisfiable byte range.
Keep the first occurrence of each log signature and sample the repeats, cutting volume while preserving new messages.
Interpret a Retry-After header as seconds or an HTTP date and cap the delay before the next retry attempt.
Enforce a per-key request rate limit with a sliding window of timestamps, smoothing the bursts a fixed window allows.
Parse and validate a W3C traceparent header into version, trace id, span id and flags, rejecting malformed values.
Verify a hex HMAC signature over a webhook body with a timestamp tolerance, using constant-time comparison.
Validate request bodies against JSON Schema compiled with AJV using OpenAPI component schemas, with fast paths and collected error details.
Buffer a stream of items into adaptive batches with async cargo, flushing on size or timing thresholds so slow items never block the queue.
Pull remote pages lazily through an async generator, batching records per yield so consumers control pacing and memory stays flat.
Race a promise against a timer so a slow dependency cannot hold a request open indefinitely, aborting the underlying signal when the deadline passes.
Implement response-layer retry in Axios via a custom interceptor with attempt counters, exponential backoff, and idempotency-aware opt-in.
Search a sorted array in logarithmic time, returning the index of a match or the insertion point when the value is absent.
Smooth bursty traffic with Bottleneck using a token reservoir, rolling rate limit, and prioritized scheduled jobs that respect a fixed quota.
Enqueue background jobs with BullMQ backed by Redis, configure exponential backoff retries, and process them in a worker with failure handling.
Parse fetched HTML with Cheerio to extract OpenGraph metadata, clean text, and attribute values without executing any page scripts.
Split an array into fixed-size batches for bulk inserts, pagination, or parallel processing without mutating the original input.
Define a GitHub Actions CI pipeline with a Node version matrix, dependency caching, conditional deployment job, and pinned action versions.
Build a git-style CLI with Commander using nested subcommands, variadic arguments, option conflict rules, and typed hook-driven configuration.
Compose a list of functions so each wraps the next, matching the middleware style used by many web frameworks.
Split a CSV line into fields while respecting quoted values that contain commas or escaped quotes, a step that naive splitting gets wrong.
Parse CSV as a stream with csv-parse, validate each row against a schema, and pipe valid records onward while collecting row-level errors.
Curry a function so partial application returns a new function until every argument is supplied, enabling reusable configured variants.
Convert timestamps between timezones with Dayjs and its UTC plugin, keeping wall-clock semantics intact and formatting per-locale output.
Debounce wraps a callback so it runs only after activity stops for a set wait, collapsing bursts of calls into a single trailing invocation.
Remove duplicate records that share a key, keeping the first or last occurrence so the result is deterministic and easy to reason about.
Clone nested objects and arrays without sharing references, using the structured clone algorithm so dates, maps, and cycles are handled correctly.
Merge nested config objects where later sources override earlier scalars but nested objects are combined recursively, a common layering need.
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.
Escape untrusted text before inserting it into HTML so angle brackets and quotes cannot break out of the surrounding context.
Build a small publish and subscribe emitter that registers listeners per event name and supports one-shot subscribers and clean removal.
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.
Read a fetch response body as a stream with manual reader control, honoring backpressure so a slow consumer cannot balloon memory.
Fetch JSON from an endpoint, applying a per-attempt timeout and retrying transient failures while treating client errors as final.
Subscribe to Firebase auth state, read the current ID token before each API call, and let the SDK refresh expired tokens transparently.
Flatten arrays nested to an arbitrary depth into a single level, with an optional depth limit so callers can control how far the flattening goes.
Validate a submitted form object against field rules and collect every error at once, so users see all problems instead of one at a time.
Configure the got client to retry transient failures with exponential backoff, status-code allowlists, and per-attempt timeouts for safer polling.
Fetch paginated GraphQL connections with graphql-request, following cursor edges and pageInfo detection until the full dataset is drained.
Group an array of records into a map keyed by one of their fields, a building block for reports, indexes, and bucketed aggregations.
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.
Verify tokens against a rotating JWKS endpoint with jose, pinning allowed algorithms and caching the key set with stale fallback on outages.
Sign and verify JWTs with the jose library using an ECDSA P-256 key pair, protected headers, and explicit audience and expiry validation.
Decode the payload of a JSON Web Token and verify that its expiry and not-before claims are respected, without trusting the token's signature blindly.
Compose Koa middleware functions in explicit execution order, tracing the onion model pass-through with early termination and downstream control.