# never-give-up

> A module which force async functions to return value, by repeating them infinite number of times, ignoring undefined values and exceptions. Could be useful while using crappy systems, but in fact **you shouldn't use this package**.

Latest version **0.1.0** (published 2018-12-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install never-give-up
pnpm add never-give-up
yarn add never-give-up
bun add never-give-up
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-12-08 |
| First published | 2018-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Rafał Rudol |
| Maintainers | rudol |

## Links

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

## Recent versions

- 0.1.0 (latest) — 2018-12-08

## README

# never-give-up

A module which force async functions to return value, by repeating them infinite number of times, ignoring undefined values and exceptions.

Could be useful while using crappy systems, but in fact **you shouldn't use this package**.

## Instalation

```sh
npm install never-give-up --save
```

## Usage

```javascript
const { neverGiveUp } = require("never-give-up");

async function russianRoulette() {
  if (Math.floor(Math.random() * 100) === 5) {
    return true;
  }
}

function veryImportantCalculations() {
  // const value = await russianRoulette(); <- but why to take such risk?
  const value = await neverGiveUp(russianRoulette);

  if (value === 5) {
    console.log('You\'re lucky!');
  } else {
    console.log('You fired!'); // It will never run, how cool is that?
  }
}
```

## License

[MIT](http://vjpr.mit-license.org)

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