Typescript + Node

typescriptSnippet

Express Rate Limit Redis Store

Apply distributed rate limiting in Express with express-rate-limit backed by a Redis store, keying by user identity and API token.

typescriptSnippet

Pino Multi-Transport Log Routing

Route Pino logs to multiple transports in parallel, sending errors to a dedicated sink while pretty console output stays development-only.

typescriptSnippet

Vitest Module Mock Unit Test

Isolate a module under test with Vitest vi.mock hoisting, typed mock functions, and restore between tests so suites stay order-independent.

typescriptSnippet

Node.js JWT Auth with TypeScript

Implement JWT authentication in a Node.js Express server with TypeScript, including token signing, verification middleware, refresh token rotation, and.

typescriptSnippet

Node.js CLI Tool with Commander

Build a type-safe CLI tool in Node.js using Commander.js with subcommands, option parsing, help generation, and TypeScript. Includes chalk-colored output.

typescriptSnippet

Node.js Typed Data Fetching

Fetch remote data in Node.js with TypeScript using generic HTTP wrappers, retry logic with exponential backoff, response parsing with Zod, and.