Back to Explore

dmmulroy/better-result

GitHub
8 updates · last 90 days1 watchersOpen source

Last release:

Better-result is a lightweight Result type for TypeScript that makes success and failures explicit, using a `Result<T, E>` pattern. It’s useful for composing multi-step workflows (including generator-based and async compositions) where failures short-circuit early and are handled as typed return values via matching or guards, helping separate expected failures from unexpected exceptions.

Project status

  • The repository (dmmulroy/better-result) appears actively maintained, with the last upstream push on 2026-08-23 and subsequent library updates in early August 2026, indicating ongoing development rather than dormancy.
  • Apparent cadence: a cluster of significant updates around 2026-08-01 to 2026-08-11 (3.0.0 and 3.0.1), followed by a quieter period with no further tagged updates evident through 2026-10-02.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v3.0.1

    v3.0.1 is described as a fix to improve TypeScript inference of callback error lanes for tryRecover and andThen. The code changes are largely type-level, centered on capturing the callback's full return type to distribute success and error lanes more accurately.

  • v3.0.0

    Release v3.0.0 finalizes the better-result 3.0 feature set around typed Result error boundaries, Standard Schema-compatible Result codecs, richer Result collection combinators, improved retry policies, and exhaustive tagged-error instance matching. The diff also shows build and documentation changes that tighten tooling expectations, including a new automated TypeScript version minimum check.

    BreakingFeatures
  • v3.0.0-rc.5

    Release v3.0.0-rc.5 release notes only mention a README documentation rewrite. The actual code diff contains meaningful library API changes, adding new unsafe codec methods with Panic-based control flow, along with new type-level behavior and test coverage.

    BreakingFeatures
  • v3.0.0-rc.4

    This release introduces a new exhaustive instance matching API, TaggedError#match, allowing TaggedError instances to dispatch handlers by _tag with strong type narrowing and inferred return unions. The change is mainly implemented in src/error.ts with accompanying type tests and documentation updates.

    Features
  • v3.0.0-rc.3

    Release v3.0.0-rc.3 adds a comprehensive documentation website built with Blume. The diff is overwhelmingly documentation and site infrastructure, with no apparent changes to the runtime library API or behavior. The only non-website change visible in the diff is the package version bump from rc.2 to rc.3.

    Features
  • v3.0.0-rc.2

    Although the release notes only mention documentation updates for adoption skills, the actual code diff contains substantive TypeScript API and type-inference changes. The largest change is that Result.tryRecover and Result.tryRecoverAsync can now widen the success type based on the recovery function's return type, and error pattern matching typing was adjusted to better preserve unhandled variants when composing with Result.err.

    BreakingFeatures
  • v3.0.0-rc.1

    v3.0.0-rc.1 introduces Standard Schema-compatible serialization via Result.codec, adds major improvements to Result.tryPromise retries (abort signal propagation, dynamic retry delays, and jitter), and enhances matchError/matchErrorPartial type inference. The code diff also contains additional API-level typing changes around retry decision callbacks that are not clearly called out in the release notes. Overall, the release looks like a v3 pre-release with multiple developer-facing type and behavior tweaks.

    BreakingFeatures
  • v2.10.0

    v2.10.0 adds a 1-based retry attempt context to the callbacks used by Result.try and Result.tryPromise retry logic. It also updates tagged error type guarding so isTaggedError can narrow to a type that includes toJSON.

    BreakingFeatures
  • v2.9.2

    Release v2.9.2 updates the package publishing configuration to include source maps in the published artifacts. This improves debugging by shipping .map files alongside the existing built outputs.

    Features
  • v2.9.1

    v2.9.1 focuses on TypeScript typing changes to improve support for explicit generic type parameters on Result instance methods. The runtime implementation appears unchanged, while several method overloads were adjusted and a compile-time test was added to verify the new typing behavior.