# NeverThrow ## Docs - [Introduction to NeverThrow](https://mintlify.wiki/supermacro/neverthrow/introduction.md): Type-safe error handling for JavaScript & TypeScript using Result and ResultAsync types - [Installation](https://mintlify.wiki/supermacro/neverthrow/installation.md): Install NeverThrow and optional ESLint plugin to enforce proper error handling - [Quick start](https://mintlify.wiki/supermacro/neverthrow/quickstart.md): Learn how to use Result types in under 5 minutes - [Result Type](https://mintlify.wiki/supermacro/neverthrow/concepts/result-type.md): Understanding the Result type and its Ok and Err variants - [ResultAsync Type](https://mintlify.wiki/supermacro/neverthrow/concepts/result-async.md): Understanding ResultAsync, how it wraps Promise, and its thenable behavior - [Error Handling Philosophy](https://mintlify.wiki/supermacro/neverthrow/concepts/error-handling.md): Why encoding errors in types is better than throwing exceptions - [Basic Usage](https://mintlify.wiki/supermacro/neverthrow/guides/basic-usage.md): Learn how to create Results, check their state, and perform basic operations - [Chaining Operations](https://mintlify.wiki/supermacro/neverthrow/guides/chaining-operations.md): Compose complex operations using map, mapErr, and andThen for elegant error handling - [Async Operations](https://mintlify.wiki/supermacro/neverthrow/guides/async-operations.md): Handle asynchronous operations with ResultAsync, fromPromise, and async/await patterns - [Combining Results](https://mintlify.wiki/supermacro/neverthrow/guides/combining-results.md): Work with multiple Results using combine and combineWithAllErrors for powerful composition - [Error Recovery](https://mintlify.wiki/supermacro/neverthrow/guides/error-recovery.md): Master error handling and recovery with orElse, match, and unwrapOr patterns - [ok()](https://mintlify.wiki/supermacro/neverthrow/api/result/ok.md): Constructor function that creates an Ok variant of Result - [err()](https://mintlify.wiki/supermacro/neverthrow/api/result/err.md): Constructor function that creates an Err variant of Result - [Result.isOk](https://mintlify.wiki/supermacro/neverthrow/api/result/is-ok.md): Check if a Result is an Ok variant - [Result.isErr](https://mintlify.wiki/supermacro/neverthrow/api/result/is-err.md): Check if a Result is an Err variant - [Result.map()](https://mintlify.wiki/supermacro/neverthrow/api/result/map.md): Transform the Ok value of a Result while leaving Err untouched - [Result.mapErr()](https://mintlify.wiki/supermacro/neverthrow/api/result/map-err.md): Transform the Err value of a Result while leaving Ok untouched - [Result.andThen()](https://mintlify.wiki/supermacro/neverthrow/api/result/and-then.md): Chain computations that return Results, useful for sequential operations that may fail - [Result.orElse()](https://mintlify.wiki/supermacro/neverthrow/api/result/or-else.md): Recover from errors by mapping Err values to new Results - [Result.match()](https://mintlify.wiki/supermacro/neverthrow/api/result/match.md): Execute different functions based on Ok or Err variant, returning a unified type - [Result.unwrapOr()](https://mintlify.wiki/supermacro/neverthrow/api/result/unwrap-or.md): Extract the Ok value or return a default value if Err - [Result.asyncMap()](https://mintlify.wiki/supermacro/neverthrow/api/result/async-map.md): Transform the Ok value with an async function, returning a ResultAsync - [Result.andTee() & Result.orTee()](https://mintlify.wiki/supermacro/neverthrow/api/result/tee-methods.md): Execute side effects without affecting the Result value - [Result.andThrough() & Result.asyncAndThrough()](https://mintlify.wiki/supermacro/neverthrow/api/result/through-methods.md): Execute operations that preserve the original value but can fail - [Result.combine() & Result.combineWithAllErrors()](https://mintlify.wiki/supermacro/neverthrow/api/result/combine.md): Combine multiple Results into a single Result - [Result.fromThrowable()](https://mintlify.wiki/supermacro/neverthrow/api/result/from-throwable.md): Convert functions that throw exceptions into functions that return Results - [okAsync](https://mintlify.wiki/supermacro/neverthrow/api/result-async/ok-async.md): Create an Ok variant of ResultAsync - [errAsync](https://mintlify.wiki/supermacro/neverthrow/api/result-async/err-async.md): Create an Err variant of ResultAsync - [ResultAsync.map](https://mintlify.wiki/supermacro/neverthrow/api/result-async/map.md): Transform the Ok value of a ResultAsync - [ResultAsync.mapErr](https://mintlify.wiki/supermacro/neverthrow/api/result-async/map-err.md): Transform the Err value of a ResultAsync - [ResultAsync.andThen](https://mintlify.wiki/supermacro/neverthrow/api/result-async/and-then.md): Chain operations that return Results - [ResultAsync.orElse](https://mintlify.wiki/supermacro/neverthrow/api/result-async/or-else.md): Recover from errors in a ResultAsync - [ResultAsync.match](https://mintlify.wiki/supermacro/neverthrow/api/result-async/match.md): Pattern match on a ResultAsync - [ResultAsync.unwrapOr](https://mintlify.wiki/supermacro/neverthrow/api/result-async/unwrap-or.md): Extract value with a default fallback - [ResultAsync tee methods](https://mintlify.wiki/supermacro/neverthrow/api/result-async/tee-methods.md): Perform side effects that don't affect the Result - [ResultAsync through methods](https://mintlify.wiki/supermacro/neverthrow/api/result-async/through-methods.md): Perform operations that preserve the value but can introduce errors - [ResultAsync.combine](https://mintlify.wiki/supermacro/neverthrow/api/result-async/combine.md): Combine multiple ResultAsyncs into one - [ResultAsync.fromPromise](https://mintlify.wiki/supermacro/neverthrow/api/result-async/from-promise.md): Create ResultAsync from Promise with error handling - [ResultAsync.fromThrowable](https://mintlify.wiki/supermacro/neverthrow/api/result-async/from-throwable.md): Wrap async functions that might throw - [safeTry()](https://mintlify.wiki/supermacro/neverthrow/api/utilities/safe-try.md): Emulate Rust's ? operator using generator syntax for cleaner error handling - [fromThrowable()](https://mintlify.wiki/supermacro/neverthrow/api/utilities/from-throwable.md): Convert throwing functions into functions that return Results - [fromAsyncThrowable()](https://mintlify.wiki/supermacro/neverthrow/api/utilities/from-async-throwable.md): Convert async throwing functions into functions that return ResultAsync - [fromPromise()](https://mintlify.wiki/supermacro/neverthrow/api/utilities/from-promise.md): Convert a Promise into a ResultAsync with error handling - [fromSafePromise()](https://mintlify.wiki/supermacro/neverthrow/api/utilities/from-safe-promise.md): Convert a Promise that never rejects into a ResultAsync - [_unsafeUnwrap() & _unsafeUnwrapErr()](https://mintlify.wiki/supermacro/neverthrow/api/testing/unsafe-unwrap.md): Unsafe methods for extracting values in test environments - [Migration Guide](https://mintlify.wiki/supermacro/neverthrow/resources/migration-guide.md): Guide for migrating between major versions of NeverThrow - [TypeScript Best Practices](https://mintlify.wiki/supermacro/neverthrow/resources/typescript-tips.md): Advanced TypeScript patterns and best practices when using NeverThrow - [ESLint Plugin](https://mintlify.wiki/supermacro/neverthrow/resources/eslint-plugin.md): Enforce proper Result handling with eslint-plugin-neverthrow - [FAQ](https://mintlify.wiki/supermacro/neverthrow/resources/faq.md): Frequently asked questions about NeverThrow - [Changelog](https://mintlify.wiki/supermacro/neverthrow/resources/changelog.md): Version history and release notes for NeverThrow ## OpenAPI Specs - [openapi](https://mintlify.wiki/supermacro/neverthrow/api-reference/openapi.json)