# @types/iferr

> TypeScript definitions for iferr

Latest version **1.0.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/iferr
pnpm add @types/iferr
yarn add @types/iferr
bun add @types/iferr
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-11-07 |
| First published | 2018-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/iferr
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iferr
- npm.io page: https://npm.io/package/@types/iferr

## Recent versions

- 1.0.4 (latest) — 2023-11-07
- 1.0.2 (ts2.0) — 2019-04-19
- 1.0.3 — 2023-10-18
- 1.0.1 — 2018-05-31
- 1.0.0 — 2018-05-22

## README

# Installation
> `npm install --save @types/iferr`

# Summary
This package contains type definitions for iferr (https://github.com/shesek/iferr).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iferr.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iferr/index.d.ts)
````ts
type nodeCallback<T> = (err: Error | null, ...a: T[]) => any;

// Delegates to `succ` on sucecss or to `fail` on error
// ex: Thing.load(123, iferr(cb, thing => ...))
declare function iferr<T>(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback<T>;

declare namespace iferr {
    // Delegates to `succ` on sucecss or to `fail` on error
    // ex: Thing.load(123, iferr(cb, thing => ...))
    function iferr<T>(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback<T>;

    // Like iferr, but also catches errors thrown from `succ` and passes to `fail`
    function tiferr<T>(fail: (err: Error) => void, succ: (...result: T[]) => void): nodeCallback<T>;

    // Delegate to the success function on success, throws the error otherwise
    // ex: Thing.load(123, throwerr(thing => ...))
    function throwerr<T>(succ: (...result: T[]) => void): nodeCallback<T>;

    // Prints errors when one is passed, or does nothing otherwise
    // ex: Thing.load(123, printerr)
    function printerr(): nodeCallback<any>;
}

export = iferr;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [segayuu](https://github.com/segayuu).

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