neverthrow

Official

Type-safe error handling for JS/TS

AuthorMontte-erp
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Replace ad-hoc exceptions and try/catch with explicit, type-safe error values so developers cannot accidentally ignore failures and must handle errors at call sites.

Core Features & Use Cases

  • Represent fallible operations as Result (sync) or ResultAsync (async) values to encode success or failure in the type system.
  • Compose and chain operations with map, mapErr, andThen, and use safeTry generator-based do-notation to eliminate boilerplate early returns.
  • Wrap synchronous throwers and Promise-returning SDKs with Result.fromThrowable and ResultAsync.fromThrowable or fromPromise, combine parallel operations with short-circuit or collect-all semantics, and enforce consumption with an eslint plugin.
  • Real-world use case: wrap database repository work in ResultAsync<AppError> and let web routers consume results and convert errors to WebAppError without try/catch.

Quick Start

Wrap a Promise-returning SDK call with ResultAsync.fromThrowable and handle the returned ResultAsync with match to convert errors into your application error type.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: neverthrow
Download link: https://github.com/Montte-erp/montte-nx/archive/main.zip#neverthrow

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.