ts-results: Rust-like Result and Option for TypeScript

JSON →
library 3.3.0 ·javascript maintenance
verified May 27, 2026

ts-results is a TypeScript library that provides compile-time error checking and optional values, inspired by Rust's `Result` and `Option` enums. It offers a type-safe approach to handling fallible operations and potential absence of values without relying on exceptions or `null`/`undefined`. The current stable version, 3.3.0, was last published in 2021. This package differentiates itself by offering a lightweight, focused implementation of these core algebraic data types, in contrast to more comprehensive functional programming libraries. It enables developers to explicitly model success (`Ok`) or failure (`Err`) states and presence (`Some`) or absence (`None`) of a value, leveraging TypeScript's type system to ensure these states are handled at compile time, thereby reducing runtime errors.

total hits 23
actors 8 distinct systems
last hit 1d ago human
GPTBot
5
Amazonbot
4
MetaBot
4
Script
1
Search engines
3
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · BD · 🇩🇪 Germany