byethrow

A lightweight Result type library

Tree-shakable error handling with functional programming approach

npm install @praha/byethrow
byethrow logobyethrow logo
🌲

🌲 Tree-shakable

Only include what you use. Lightweight and optimized for modern bundlers.

🧱

🧱 Object-based Design

No classes, no magicβ€”just plain objects with consistent API design.

πŸ”„

πŸ”„ Unified Sync/Async

Works seamlessly with both Result<T, E> and Promise<Result<T, E>>.

🎯

🎯 Focused Functionality

Result-centric utilities without unnecessary aliases or confusing variants.

πŸ”—

πŸ”— Composable Pipeline

Powerful pipe function and chainable operations like andThen, andThrough for clean data flow.

πŸ›‘οΈ

πŸ›‘οΈ Type-safe Validation

Built-in schema validation support with comprehensive error handling and type inference.