# every-fn

> Helper that runs each function in a list until one fails

Latest version **1.0.6** (published 2020-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install every-fn
pnpm add every-fn
yarn add every-fn
bun add every-fn
```

## 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.6 |
| Published | 2020-11-08 |
| First published | 2018-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ryan Mahoney |
| Maintainers | opinephp |
| Keywords | helper |

## Links

- npm: https://www.npmjs.com/package/every-fn
- Repository: https://github.com/ryan-mahoney/Every-Fn
- Issues: https://github.com/ryan-mahoney/Every-Fn/issues
- npm.io page: https://npm.io/package/every-fn

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2020-11-08
- 1.0.5 — 2018-07-31
- 1.0.4 — 2018-04-28
- 1.0.3 — 2018-04-28
- 1.0.2 — 2018-04-27
- 1.0.1 — 2018-04-27
- 1.0.0 — 2018-04-27

## README

# Every-Fn

## Every

`every` is a function that iterates over an list of functions until one of the functions returns `false`. The output of each function is merged into the output of the previously called function and passed as input to the next function call.

An optional initial state object may be provided as a second argument.

If an asynchronous function is specified, `every` will `await` it's return before calling the next function.

For example: `sample-controller.js`

```javascript
import { every } from "every-fn";
import {
  validateInput,
  sendValidationErrors,
  cleanUserInput,
  findCustomer,
  handleDbError,
  sendCustomerExistsError,
  sendLoginSuccessResponse
} from "./lib/customer-login.js";

export const loginCustomer = async (req, res) =>
  await every(
    [
      validateInput,
      sendValidationErrors,
      cleanUserInput,
      findCustomer,
      handleDbError,
      sendCustomerExistsError,
      sendLoginSuccessResponse
    ],
    { req, res }
  );
```

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