Safe, idiomatic TypeScript library for handling null, errors, and async operations with Maybe, Result, and Task types.
True Myth is a TypeScript library that provides safe, idiomatic wrappers for handling null values, errors, and asynchronous operations. It introduces Maybe, Result, and Task types to eliminate common runtime errors and improve code reliability by enforcing type-safe patterns for optional values, success/failure states, and async workflows.
TypeScript developers building applications that require robust error handling, null safety, or managed asynchronous operations, particularly those familiar with or interested in functional programming patterns.
Developers choose True Myth for its combination of type safety, idiomatic TypeScript design, and inspiration from proven functional programming languages like Rust and Elm, offering a lightweight, tree-shakeable alternative to manual error handling or less integrated libraries.
Safe and idiomatic TypeScript types to handle null, error, and async code handling: Maybe, Result, and Task types that are really nice.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Fully typed with TypeScript, ensuring compile-time checks for correct usage of Maybe, Result, and Task, as highlighted in the project's focus on eliminating runtime errors.
Designed to feel natural in TypeScript/JavaScript with a clean, chainable interface, making adoption smoother without a steep functional programming curve.
Tree-shakeable build allows bundlers to include only used parts; the total library size is around 5.2KB after compression, as detailed in the bundle size table.
Draws from reliable patterns in Rust, Elm, and Folktale, providing well-tested wrappers for common scenarios like missing values and errors, with 100% test coverage.
Requires TypeScript 5.3+, moduleResolution set to Node16 or later, and strict mode enabled, which can be a barrier for teams with legacy or non-standard configurations.
Developers unfamiliar with monadic types like Maybe and Result will need to invest time in understanding the patterns, despite the idiomatic API, which may slow initial adoption.
Compared to libraries like fp-ts, True Myth focuses on core types without offering more advanced functional abstractions, which might limit utility for complex functional programming projects.