Typescript Examples

Page 4 of 6

Browse Typescript examples

typescriptSnippet

Error Classify And Map

Classify errors by type and map to appropriate HTTP status codes with retry decisions for API layers.

typescriptSnippet

File Hash Manifest

Build a sorted SHA-256 manifest of file contents so unchanged inputs can be skipped and integrity verified.

typescriptSnippet

Typed Async Retry Helper

A generic retry helper that preserves the resolved value type, caps attempts, and backs off between failures without losing type information.

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

Generic API Response Envelope

Wrap API payloads in a generic envelope type carrying status, data, and optional error metadata so clients get full inference from a single shape.

typescriptSnippet

Next SSR Error Boundary Recovery

Contain server rendering failures in Next.js with route-level error boundaries, distinguishing retryable render errors from hard failures.

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.