awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
supermacro avatar

supermacro/neverthrow

0
View on GitHub↗
7,201 stars·144 forks·TypeScript·mit·11 views

Neverthrow

neverthrow is a TypeScript result type library that implements railway oriented programming. It provides a functional error handling framework using type-safe wrappers to represent operation outcomes as either success or failure variants, eliminating the need to throw exceptions.

The library features adapters that convert throwing functions and asynchronous promises into typed result objects. This allows asynchronous rejections and unsafe code to be handled as explicit return values rather than uncaught exceptions.

The framework covers a broad range of functional computation capabilities, including monadic chaining for sequential operations, error aggregation for collecting multiple failures, and result matching to ensure exhaustive error handling. It also provides mechanisms for error recovery, value transformation, and the execution of side effects on both success and failure tracks.

Additional support is provided for generator functions to implicitly handle errors and unwrap success values within a block.

Features

  • Result - Implements a type-safe result wrapper based on sum types to represent operation outcomes as success or failure variants.
  • Monadic Error Handling - Implements a comprehensive framework for monadic error handling using Result types to manage flow without exceptions.
  • TypeScript Utility Libraries - Provides a type-safe result utility library for TypeScript to represent operation outcomes as success or failure variants.
  • Promise-to-Result Converters - Transforms promises into result types by mapping rejections into specific, type-safe errors.
  • Async Result Wrappers - Provides wrappers that convert promises into result types to handle asynchronous rejections as typed values.
  • Promise-to-Result Wrappers - Transforms asynchronous promises into typed result objects with integrated mapping and chaining capabilities.
  • Result Sequence Processing - Allows executing a sequence of dependent operations that halt immediately upon the first encountered error.
  • Throwable Function Adapters - Converts functions that throw exceptions into result-returning functions by mapping unknown errors to known types.
  • Exception-to-Result Adapters - Provides a utility to wrap throwing functions, ensuring all potential failures are handled via return types.
  • Result Transformations - Provides monadic chaining to transform success values while automatically propagating errors.
  • Asynchronous Result Wrappers - Wraps promises in a specialized class to provide mapping and chaining without requiring immediate awaiting.
  • Throwable Function Adapters - Result converts potentially throwing functions into a consistent result type to ensure all errors are handled explicitly.
  • Success and Failure Wrapping - Wraps return values in specific types to distinguish between successful outcomes and expected errors without throwing.
  • Promise-To-Result Adaptation - Includes adapters that convert asynchronous promises into typed result objects to handle rejections as explicit values.
  • Operation Chaining - Provides monadic chaining mechanisms to sequentially transform values through a series of functions.
  • Railway Oriented Programming - Implements a pipeline pattern where operations either continue on a success track or diverge to an error track.
  • Variant-Based Outcome Encoding - Encodes the result of an action as either a success or failure variant to avoid throwing exceptions.
  • Exhaustive Result Handling - Executes one of two functions based on whether the outcome is a success or failure to ensure both cases are handled.
  • Generator-Based Error Propagation - Utilizes generator functions and yield expressions to implicitly handle errors and unwrap success values.
  • Generator-Based Unwrapping - Supports generator functions to implicitly handle errors and unwrap success values within a block.
  • Generator Block Aborting - Uses generator functions to yield values and automatically abort the block if any operation returns a failure.
  • Validation Error Aggregators - Allows collecting multiple independent failures into a single structured collection instead of stopping at the first error.
  • Cumulative Error Collection - Implements error aggregation logic to collect multiple independent failures into a single list.
  • Error Recovery - Handles failure cases and optionally transforms the resulting type to resume normal execution.
  • Exhaustive Matching - Provides result matching to ensure exhaustive error handling by requiring specific functions for both success and failure cases.
  • Result Value Extraction - Provides methods to retrieve a success value or return a specified default if the operation failed.
  • Railway Side Effects - Provides mechanisms for executing side effects on both success and failure tracks without altering the result value.
  • Result-Track Side Effects - Provides utilities to execute arbitrary logic on either the success or failure track without changing the result's state.
  • Task Result Aggregation - Merges a list of outcomes into one result by either stopping at the first failure or gathering all errors.
  • Result-Track Side Effects - Enables performing actions like logging specifically when an operation fails without altering the error object.
  • Algebraic Data Types - Result type for representing success or failure.

Star history

Star history chart for supermacro/neverthrowStar history chart for supermacro/neverthrow

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does supermacro/neverthrow do?

neverthrow is a TypeScript result type library that implements railway oriented programming. It provides a functional error handling framework using type-safe wrappers to represent operation outcomes as either success or failure variants, eliminating the need to throw exceptions.

What are the main features of supermacro/neverthrow?

The main features of supermacro/neverthrow are: Result, Monadic Error Handling, TypeScript Utility Libraries, Promise-to-Result Converters, Async Result Wrappers, Promise-to-Result Wrappers, Result Sequence Processing, Throwable Function Adapters.

What are some open-source alternatives to supermacro/neverthrow?

Open-source alternatives to supermacro/neverthrow include: rust-lang/rust-by-example — This project is an interactive programming education resource and tutorial designed for learning the Rust programming… error-or/error-or — Error-or is a library that implements the result pattern to replace exception-based control flow with structured data.… carp-lang/carp — Carp is a statically typed Lisp compiler that compiles Lisp-like syntax directly to C source code, enabling seamless… dry-python/returns — Returns is a functional programming library for Python that provides type-safe containers for managing state, error… arrow-kt/arrow — Arrow is a functional programming library for Kotlin that provides tools for implementing data-oriented programming… vkhorikov/csharpfunctionalextensions — CSharpFunctionalExtensions is a functional programming library for C# that provides a framework of monadic containers,…

Open-source alternatives to Neverthrow

Similar open-source projects, ranked by how many features they share with Neverthrow.
  • rust-lang/rust-by-examplerust-lang avatar

    rust-lang/rust-by-example

    8,026View on GitHub↗

    This project is an interactive programming education resource and tutorial designed for learning the Rust programming language and systems programming concepts. It provides a collection of runnable and editable code examples that serve as a practical reference for language syntax and implementation. The resource features an interactive code sandbox that allows users to execute and test code snippets in real time. It emphasizes the verification of technical accuracy by executing embedded code blocks during the build process to ensure all examples remain functional. The content covers a compre

    Handlebars
    View on GitHub↗8,026
  • error-or/error-orerror-or avatar

    error-or/error-or

    2,058View on GitHub↗

    Error-or is a library that implements the result pattern to replace exception-based control flow with structured data. It provides a discriminated union implementation that encapsulates either a successful value or an error state within a single type, ensuring that operation outcomes are treated as first-class values. The library enables functional error handling by providing a fluent interface for chaining sequential operations. This monadic pipeline composition allows developers to define dependent operations that automatically short-circuit and return an error if any individual step in the

    C#
    View on GitHub↗2,058
  • carp-lang/carpcarp-lang avatar

    carp-lang/Carp

    5,815View on GitHub↗

    Carp is a statically typed Lisp compiler that compiles Lisp-like syntax directly to C source code, enabling seamless integration with existing C libraries and low-level system programming. It manages memory deterministically at compile time using ownership tracking and linear types, eliminating garbage collection pauses and runtime overhead while ensuring type safety through an inferred static type system. The language distinguishes itself through compile-time macro expansion and metaprogramming capabilities, allowing code generation and transformation before final binary output. It enforces

    Haskellfunctionalfunctional-programminggame-development
    View on GitHub↗5,815
  • dry-python/returnsdry-python avatar

    dry-python/returns

    4,310View on GitHub↗

    Returns is a functional programming library for Python that provides type-safe containers for managing state, error handling, and optionality. It serves as a monadic container library and a type-safe error handling framework, replacing traditional try-catch blocks and null checks with Result and Optional containers to treat exceptions as data. The project is distinguished by its use of a specialized Mypy static analysis plugin to validate functional pipelines and emulate higher kinded types. It provides mechanisms for isolating side effects through IO containers and offers a framework for typ

    Python
    View on GitHub↗4,310
See all 30 alternatives to Neverthrow→