# catch-if

> A catIf syntactic sugar for Javscrip promises

Latest version **0.0.1** (published 2017-06-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-06-23 |
| First published | 2017-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | harish2704 |

## Links

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

## Recent versions

- 0.0.1 (latest) — 2017-06-23

## README

# catch-if.js
A catIf syntactic sugar for Javscrip promises

## Installation
```
npm i catch-if -S
```

## Usage 

### Step:1 - Monkeypatch your Promise class
```javascript
require('catch-if')(Promise);
```

### Step:2 - Use catchIf method
```javascript
Promise.reject( new TypeError() )
.catchIf( TypeError, function handler(err){ console.log('TypeError handled')} )
.catchIf( RangeError, function handler(err){ console.log('RangeError handled')} )
```

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