{"repo":"supermacro/neverthrow","free":true,"listed":false,"github":"https://github.com/supermacro/neverthrow","clone":"git clone https://github.com/supermacro/neverthrow.git","description":"Type-Safe Errors for JS & TypeScript","language":"TypeScript","stars":7674,"topics":["functional-programming","typescript"],"license":"MIT","category":"dev-tools","readme_excerpt":"NeverThrow 🙅 Description Encode failure into your program. This package contains a Result type that represents either success ( Ok ) or failure ( Err ). For asynchronous tasks, neverthrow offers a ResultAsync class which wraps a Promise and gives you the same level of expressivity and control as a regular Result . ResultAsync is thenable meaning it behaves exactly like a native Promise ... except you have access to the same methods that Result provides without having to await or .then the promise! Check out the wiki for examples and best practices. Need to see real-life examples of how to leverage this package for error handling? See this repo: https://github.com/parlez-vous/server Table Of Contents Installation Recommended: Use eslint-plugin-neverthrow Top-Level API API Documentation + Synchronous API ( Result ) - ok - err - Result.isOk (method) - Result.isErr (method) - Result.map (method) - Result.mapErr (method) - Result.unwrapOr (method) - Result.andThen (method) - Result.asyncAndThen (method) - Result.orElse (method) - Result.match (method) - Result.asyncMap (method) - Result.andTee (method) - Result.orTee (method) - Result.andThrough (method) - Result.asyncAndThrough (method) - Result.fromThrowable (static class method) - Result.combine (static class method) - Result.combineWithAllErrors (static class method) - Result.safeUnwrap() + Asynchronous API ( ResultAsync ) - okAsync - errAsync - ResultAsync.fromThrowable (static class method) - ResultAsync.fromPromise (static","default_branch":null,"files":null,"tree":[],"storefront":"/r/supermacro","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/supermacro/neverthrow/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}