# async-nocatch

> No need to use try/catch to handle your async/await functions

Latest version **1.0.1** (published 2018-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-nocatch
pnpm add async-nocatch
yarn add async-nocatch
bun add async-nocatch
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-06-29 |
| First published | 2018-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Anton Kosykh |
| Maintainers | kelin2025 |

## Links

- npm: https://www.npmjs.com/package/async-nocatch
- Repository: https://github.com/Kelin2025/async-nocatch
- npm.io page: https://npm.io/package/async-nocatch

## Recent versions

- 1.0.1 (latest) — 2018-06-29
- 1.0.0 — 2018-06-29

## README

# async-nocatch

Get rid of `try/catch` wrappers for your `async/await` functions.

## Why?

- Unnecessary nesting
- Failure is not always an **error** but `try/catch` means handling **error**
- You should always `catch`

## Installation

```bash
npm i async-nocatch # or yarn add async-nocatch
```

```js
import nocatch from "async-nocatch"

// For example
const nocatchFetch = nocatch(fetch)
```

## Before

```js
try {
  const result = await fetch('https://api.github.com/users')
  console.log('Done', result)
} catch (error) {
  console.log('Fail', error)
}
```

## After

```js
const { success, result } = await nocatchFetch('https://api.github.com/users')

if (success) {
  console.log('Done', result)
} else {
  console.log('Fail', result)
}
```

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