🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

neverthrow

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neverthrow

Stop throwing errors, and instead return Results!

Source
npmnpm
Version
0.1.1-alpha
Version published
Weekly downloads
1.6M
-10.21%
Maintainers
1
Weekly downloads
 
Created
Source

NeverThrow

Encode failure into your program.

This program contains a Result type that represents either success (Ok) or failure (Err).

This package works for both JS and TypeScript. However, the types that this package provides will allow you to get compile-time guarantees around error handling if you are using TypeScript.

A note on the Package Name

Although the package is called neverthrow, please don't take this literally. I am simply encouraging the developer to think a bit more about the ergonomics and usage of whatever software they are writing. Throwing and catching is syntactic sugar for goto statements - in other words; it makes reasoning about your programs harder.

With all that said, there are definitely good use cases for throwing in your program. But much less than you might think.

FAQs

Package last updated on 28 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts