Skip to content
@zerothrow

Zero Throw

Type-safe error handling for TypeScript with Rust-style Result<T,E> patterns

ZeroThrow penguin

ZeroThrow

Rust-grade ✧ Result<T, E> for TypeScript

npm (alpha) MIT License


Stop throwing – start returning.

ZeroThrow makes every error path visible and typed, eliminating hidden exceptions and async surprises.

// with ZeroThrow
function readJSON(f: string): ZT.Result<Config, ZT.ZeroError> {
  return ZT.try(() => fs.readFileSync(f, "utf8"))
    .andThen(txt => ZT.try(() => JSON.parse(txt)));
}

Packages

pkg status what it does
@zerothrow/core alpha (dev-preview) Result types + combinators
@zerothrow/react 🚧 in-progress Suspense & error-boundary hooks
@zerothrow/eslint-plugin 📝 planned no-throw rule & autofix helpers
@zerothrow/logger-pino 📝 planned Structured JSON serializers
@zerothrow/cli 📝 planned Codemods & migrations

Quick Start

# until beta we publish under the `alpha` tag
npm install @zerothrow/core@alpha
import { ZT } from "@zerothrow/core";

const safeParse = ZT.fromThrowable(
  JSON.parse,
  () => "INVALID_JSON"
);

safeParse('{"ok":true}')
  .map(x => x.ok)
  .unwrapOr(false);        // → true

Why ZeroThrow?

🚨 Pain 💡 Relief
Production crashes from hidden throw All error paths are in the type signature
Pyramid of try/catch Fluid map, andThen, match combinators
Slow stack unwinding Result path ~90× faster than throw/catch on error
Team glue-code divergence ESLint plugin (coming) enforces one pattern

Roadmap

Q3 '25 Q4 '25 Q1 '26
Alpha
core stable, dog-food in prod
Beta
React, logger, ESLint, CLI
1.0
docs site, Deno & edge builds

(Semantic-versioning guarantees start at beta.)


Contributing

We ♥ early adopters. Ways to help:

  • Try @zerothrow/core and open defects
  • Join the discussion on patterns & naming in Discussions
  • ⭐ Star the repo – motivation fuel

Full contributing guide will land before beta.


Licensed under MIT © 2025 J. Kirby Ross & contributors

Exceptions fly; Results flow.

Pinned Loading

  1. zerothrow zerothrow Public

    Rust-grade Result<T,E> for TypeScript—banish throw to the Phantom Zone.

    TypeScript 1

Repositories

Showing 2 of 2 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…