# never-catch

> A design pattern to implement result in functions.

Latest version **1.1.0** (published 2023-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install never-catch
pnpm add never-catch
yarn add never-catch
bun add never-catch
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-12-27 |
| First published | 2022-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | MRNafisiA |
| Maintainers | mrnafisia |
| Keywords | design-pattern, design, pattern, function |

## Links

- npm: https://www.npmjs.com/package/never-catch
- Repository: https://github.com/MRNafisiA/never-catch
- Homepage: https://github.com/MRNafisiA/never-catch#readme
- Issues: https://github.com/MRNafisiA/never-catch/issues
- npm.io page: https://npm.io/package/never-catch

## Recent versions

- 1.1.0 (latest) — 2023-12-27
- 1.0.9 — 2023-06-01
- 1.0.8 — 2023-06-01
- 1.0.7 — 2022-06-22
- 1.0.6 — 2022-06-12
- 1.0.5 — 2022-06-12
- 1.0.4 — 2022-06-04
- 1.0.3 — 2022-06-04
- 1.0.2 — 2022-06-04
- 1.0.1 — 2022-06-03
- 1.0.0 — 2022-06-01

## README

# never-catch

* No boilerplate
* Type support
* Auto type infer

```typescript
const divideTenBy = (a: number) => {
    if (a === 0) {
        return err('divide by zero');
    } else {
        return ok(10 / a);
    }
};

const result = divideTenBy(5);
if (result.ok) {
    console.log(result.value);// OK
} else {
    console.log(result.error);// Ok
    console.log(result.value);// TS2339: Property 'value' does not exist on type 'Err '.
}
```

Email: mnafisiasl@gmail.com

---
_Source: https://npm.io/package/never-catch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
