Dev.to
5/12/2026

Rest In Peace, Throw: TypeScript error handling 22x faster in just 1.6KB
Short summary
ripthrow v3.0 introduces Rust-inspired, type-safe error handling to TypeScript in a minimal 1.6KB library. Benchmarks show 22x faster operations versus native throw (25M vs 1.2M ops/sec) by using Plain Old JavaScript Objects instead of exception classes. Exhaustive pattern matching enforces all error cases are handled at compile-time.
- •22x performance improvement over native throw with zero-dependency library
- •Type-safe error handling prevents forgotten error cases via exhaustive matching
- •1.6KB minified+gzipped, uses POJOs for speed
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



