flowshield: TypeScript Resilience Library (Circuit Breaker, Retry, Timeout) for Edge Runtimes
Why Resilience Matters in Production Every distributed system fails eventually. APIs time out, databases get overloaded, third-party services go down. Without resilience patterns, one failing depen...

Source: DEV Community
Why Resilience Matters in Production Every distributed system fails eventually. APIs time out, databases get overloaded, third-party services go down. Without resilience patterns, one failing dependency can cascade into a full system outage. flowshield is a zero-dependency TypeScript-first resilience library that gives you composable fault-tolerance policies for any async operation. GitHub: https://github.com/Avinashvelu03/flowshield npm: npm install flowshield What's Inside Retry with Exponential Backoff import { retry } from 'flowshield'; const result = await retry( () => fetchFromAPI(), { attempts: 3, backoff: 'exponential', baseDelay: 100 } ); Circuit Breaker Automatically stops calling a failing service and recovers when it's healthy: import { circuitBreaker } from 'flowshield'; const breaker = circuitBreaker({ threshold: 5, // open after 5 failures timeout: 30_000, // try again after 30s halfOpenRequests: 2 // test with 2 requests }); const result = await breaker.execute(() =&