TypeScript implementation of the Result
type from Rust
with a full-fledged
interface to work with async primitives.
Also check out eslint-plugin-resulto. This ESLint plugin ensures that your Results are used to prevent leaving Err variants unhandled.
npm install resulto
https://jsr.io/@resulto/core/doc
Exceptions are dangerous. Most of the time you do not know some function you use
could throw, you forget to wrap this function in a try/catch
block and deploy
your broken application to production.
Exceptions are ugly. Wraping each function call that may throw in a try/catch
block for regular control flow lead to convoluted and smelly code.
There are many packages that implement Result
, but there is no package that
implements a full-fledged interface to work with async primitives and an
ESLint
package to make sure Results
are handled.
That is why I made this repository: to make my life and the lives of other developers easier.