DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

errval Brings Go-Style Explicit Errors to TypeScript—with Trade-offs

errval uses an error-first tuple inspired by Go’s explicit returns. Here is how the author says its TypeScript API works, plus the limits of its type and performance claims.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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 Programming Language - Software Engineer & Coder T-Shirt
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.