Developer builds errval to bring Go-style error handling to TypeScript
A developer who works primarily in TypeScript and Go built errval, a lightweight TypeScript library that brings Go-style explicit error returns to TypeScript projects. The library weighs just 1.86 kB minified and gzipped, has zero dependencies, and works across Node, Bun, and Deno runtimes. It uses a tuple pattern — const [err, value] — where the error is placed first to prevent developers from accidentally ignoring it. Benchmarks show errval handles failure-path requests at 226 ns per request, slower than neverthrow's 198 ns but significantly faster than plain try/catch at 2,623 ns on the failure path. The project is at version 0.1, currently maintained by a single developer, and is available via npm and GitHub.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in