@@ -15,38 +15,52 @@ A concise, type-safe error handling toolkit for TypeScript inspired by Rust's th
1515` @thaterror/core ` package to define domain-driven error families with zero boilerplate, then adopt
1616or serialize them with optional adapters (for example, a ` pino ` adapter is available).
1717
18- This repository is split into focused packages:
18+ ## The Core Value
19+
20+ Handling ` Error ` in large-scale TypeScript projects can be frustrating:
21+
22+ - ` instanceof ` is not always reliable across different packages, multiple versions, or due to structural typing matches.
23+ - Error context (Payload) is often lost during propagation.
24+ - Integrating third-party errors (e.g., ` Hono ` , ` TypeORM ` , ` SyntaxError ` ) into your domain model usually requires messy
25+ manual conversion.
1926
20- - [ packages/core ] ( ./packages/core ) — the main library: how to define errors, strong typing, adapters.
21- - [ packages/pino-adapter ] ( ./packages/pino-adapter ) — a small adapter to serialize ` ThatError ` instances for ` pino ` .
27+ ` thaterror ` solves these with a ** Schema-first ** philosophy, bringing ** Rust-like ergonomics ** to TypeScript error
28+ handling .
2229
23- Quick links
30+ ## ✨ Features
2431
25- - Core docs and examples: ./packages/core/README.md
26- - Pino adapter: ./packages/pino-adapter/README.md
32+ - ** 🎯 Zero Boilerplate** : A single ` That ` call generates error factories with built-in type guards and payload
33+ support.
34+ - ** 🏗️ Domain-Driven** : Define error families that encapsulate your business logic.
35+ - ** 🌉 Native Integration** : "Naturalize" external errors into your family using ` enroll ` and ` bridge ` .
36+ - ** 🧠 Intelligent Transformation** : The ` from ` method provides strict type checking, ensuring only registered error
37+ types are processed.
38+ - ** 🦾 Total Type Safety** : Perfect type narrowing that automatically infers payload types from your schema.
39+ - ** 🦀 thiserror-like Experience** : Declarative, robust, and designed for developers who value type correctness.
40+
41+ ## 🚀 Quick Start
42+
43+ This repository is split into focused packages:
44+
45+ - [ @thaterror/core ] ( ./packages/core ) — the main library: how to define errors, strong typing, adapters.
46+ - [ @thaterror/pino-adapter ] ( ./packages/pino-adapter ) — a small adapter to serialize ` ThatError ` instances for ` pino ` .
2747
2848Installation
2949
3050To use the core library:
3151
3252``` bash
33- npm install @thaterror/core
34- # or with bun
3553bun add @thaterror/core
54+ // or with npm
55+ npm install @thaterror/core
3656```
3757
3858If you want the pino adapter for structured logging:
3959
4060``` bash
41- npm install @thaterror/pino-adapter pino
61+ bun add @thaterror/pino-adapter pino
4262```
4363
44- Why split the docs?
45-
46- - The repo root stays as a short project overview and entry point.
47- - ` packages/core ` contains the concrete usage examples, API examples and advanced topics.
48- - Package READMEs (like the pino adapter) are short and focused on integration and examples.
49-
5064Contributing
5165
5266See the individual package READMEs for development and testing instructions.
0 commit comments