{"schemaVersion":1,"id":"neverthrow","name":"neverthrow","locale":"en","canonicalUrl":"https://base.akulich.dev/en/library/neverthrow/","officialUrl":"https://github.com/supermacro/neverthrow","isCatalog":false,"description":"Typed Result and ResultAsync for TypeScript: they make expected errors an explicit part of a function's return value.","tasks":["Make an expected error part of the result","Connect Result/ResultAsync composition to error handling by calling code"],"categoryIds":["backend"],"subcategoryIds":["backend.api"],"tags":["neverthrow","API","Development"],"aliases":["supermacro/neverthrow","neverthrow","type-safe-errors"],"platforms":[],"stack":[],"compatibility":null,"pricing":"free","freeUsage":"Code and local use under MIT.","paidUsage":"Computing resources, self-hosting, and external services are paid for separately if used.","license":"MIT for the code; dependencies have separate licenses.","selectionGuide":{"purpose":"Make an expected error part of the result","chooseWhen":["Make an expected error part of the result","Connect Result/ResultAsync composition to error handling by calling code"],"considerInstead":[],"requirements":[],"limitations":["Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.","Terms of use: MIT for the code; dependencies have separate licenses.","fromSafePromise does not convert rejection to Err; use it only for a genuinely safe Promise. The name neverthrow does not guarantee that third-party code will not throw exceptions."],"faq":[{"question":"What can you use for free in neverthrow?","answer":"Code and local use under MIT."},{"question":"What additional costs might arise with neverthrow?","answer":"Computing resources, self-hosting, and external services are paid for separately if used."},{"question":"What terms of use matter for neverthrow?","answer":"MIT for the code; dependencies have separate licenses."},{"question":"How do you get started with neverthrow?","answer":"Define success/error types for the backend operation. Connect Result/ResultAsync composition to error handling by calling code. Add error handling and an integration check of the result."},{"question":"How does ResultAsync differ from Promise, and does it catch every throw?","answer":"Result/ResultAsync represent success and errors as typed values. map/mapErr transform branches, andThen composes operations, combine returns the first error, and combineWithAllErrors returns all errors. fromPromise handles rejection of an already created Promise; a synchronous throw while calling a function before creating it requires fromThrowable."}],"related":[],"sources":["https://github.com/supermacro/neverthrow","https://raw.githubusercontent.com/supermacro/neverthrow/HEAD/README.md","https://raw.githubusercontent.com/supermacro/neverthrow/HEAD/LICENSE","https://www.open-source-tools.com/","https://raw.githubusercontent.com/supermacro/neverthrow/master/README.md"]},"selectionCheckedAt":null,"applicationGuide":{"goal":"Make an expected error part of the result.","inputs":["A data contract or HTTP workflow.","A project with a supported runtime."],"steps":["Define success/error types for the backend operation.","Connect Result/ResultAsync composition to error handling by calling code.","Add error handling and an integration check of the result."],"checks":["Invalid and missing data are handled predictably.","Types and the actual response agree; errors are not hidden."]},"sources":["https://github.com/supermacro/neverthrow","https://raw.githubusercontent.com/supermacro/neverthrow/HEAD/README.md","https://raw.githubusercontent.com/supermacro/neverthrow/HEAD/LICENSE","https://www.open-source-tools.com/","https://raw.githubusercontent.com/supermacro/neverthrow/master/README.md"],"checkedAt":"2026-10-06","reviewScope":"The purpose, current repository license, and separate terms for code, services, and models have been reviewed. The product was not run, and no security audit was performed.","relatedIds":[],"dataVersion":"cbbe7123b47a5ae80983","type":"Backend / API library","kind":"library","pricingNote":"Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.","notes":null,"labeledSources":[{"url":"https://github.com/supermacro/neverthrow","label":"Official source"},{"url":"https://raw.githubusercontent.com/supermacro/neverthrow/HEAD/README.md","label":"Official source"},{"url":"https://raw.githubusercontent.com/supermacro/neverthrow/HEAD/LICENSE","label":"License"},{"url":"https://www.open-source-tools.com/","label":"Catalog / discovery source"},{"url":"https://raw.githubusercontent.com/supermacro/neverthrow/master/README.md","label":"Official source"}],"licenseGuides":[{"id":"mit","title":"MIT — permissive license","scope":null,"summary":"You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.","url":"https://opensource.org/license/mit"}],"entryIds":[],"composition":null}