What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
errval is a TypeScript library whose author describes it as a way to return errors explicitly, inspired by Go’s error-return convention. Its central idea is a tuple with the error first—[err, user]—so the caller checks the error before using the success value. The package author also says errval infers error unions and offers a match API that requires handlers for each possible error; those implementation and type-checking claims have not been independently verified here.
What errval is trying to solve
Go commonly signals failure by returning an error as an additional value. The Go Project puts it plainly: “Errors are indicated by returning an error as an additional return value from a function,” and “A nil value means that there was no error.” Go Wiki: Errors
As an Amazon Associate I earn from qualifying purchases.
errval’s author, Aymane Aallaoui, says the motivation came from returning to TypeScript after Go: “When I switch back from Go, I miss explicit error returns.” In his description, errval brings an error-first return shape to TypeScript rather than relying on exceptions as the only visible failure path. It is an author-created library, not an official Go port or a TypeScript language feature. Aymane Aallaoui’s errval article
How the error-first tuple is meant to work
The author illustrates a function returning a tuple such as [err, user]. The caller checks if (err) first, handles that branch, and then uses user on the success path. The error occupies the first position, which the author says is intended to make it harder to ignore failure accidentally by extracting only the success value.
#1 Best Overall
That pattern resembles Go’s explicit return-and-check convention, but it is not the same language feature: the Go documentation describes an error return and a nil check, while errval is a TypeScript library API. TypeScript’s own control-flow analysis can narrow union types after checks; this provides language-level context for why a checked branch may have a more specific type, but it does not confirm how errval implements its tuple or inference. TypeScript Handbook: Narrowing
What the author claims about type safety
Aallaoui says errval infers an error union from calls to fail(), and that its match operation requires a handler for every possible error case. If that description holds in the package’s implementation, it would make the set of declared failure cases visible to TypeScript’s type checker and help catch an omitted case during compilation.
Rank #2
- TypeScript implements a superset of syntax for strictly typed development, facilitating deep static analysis and enhanced development environment integration. The compiler translates source into standard script formats, ensuring parity across any runtime.
- TypeScript is ideal for front-end developers, full-stack engineers, and software architects who build large-scale web applications. It serves those looking to improve code excellence, reduce bugs through static checking, and maintain complex projects more.
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
This is a stronger claim than Go’s ordinary error-return convention. The Go source cited here explains that callers receive and check errors; it does not say Go forces every error to be handled. For errval, the inference and exhaustive-matching behavior are claims in the author’s post, not independently confirmed guarantees.
Reported size, compatibility, and performance
In his September 20, 2026 article, Aallaoui described errval as version 0.1, with zero dependencies, a minified-and-gzipped size of 1.86 kB, and support for Node, Bun, and Deno. He also says its errors are real objects that satisfy instanceof Error. These are dated author statements; the current package version, compatibility details, and implementation were not independently established.
The same article reports a benchmark using Node 24.16 in a workload where half of requests fail. The author measured the following per-request times:
| Approach | Reported time per request | Context |
|---|---|---|
| neverthrow | 198 ns | Author’s Node 24.16 benchmark; half of requests fail. |
| errval | 226 ns | Author’s Node 24.16 benchmark; half of requests fail. |
| try/catch | 2,623 ns | Author’s Node 24.16 benchmark; half of requests fail. |
Effect runSync |
3,952 ns | Author’s Node 24.16 benchmark; half of requests fail. |
For a separate no-failure comparison, the author reports 195 ns per request for try/catch and 203 ns for errval. He also reports 1,978 ns to create an Error subclass versus 25 ns for an errval error in an error-construction breakdown. All these numbers come from one author’s test setup, not an independent benchmark, and should not be treated as general runtime expectations. The article’s stated aim is inferred error unions rather than maximum speed; on its failure-heavy figures, neverthrow is faster than errval, while try/catch is faster than errval in the no-failure comparison. Benchmark and design details from the author
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What remains uncertain before adopting it
The author’s post links to the package and its source, but the repository was not available for independent inspection. The article therefore does not establish errval’s current version, license, exact API, test coverage, implementation behavior, or present compatibility across runtimes. Developers considering it should verify those details directly in the package and repository before relying on the reported API or runtime claims.
For a Go-experienced TypeScript developer, the appeal is a familiar explicit failure path, paired with the author’s claimed inferred error cases. The trade-off is that the reported benchmarks do not make errval the fastest option in the author’s own comparisons, and its type-safety claims remain author-reported rather than independently validated.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




