# fn-onion

> compose functions to one which will be excuted like onion. re-factor from koajs/compose so that you can custom args.

Latest version **0.2.0** (published 2019-06-05) · 0 weekly downloads

## Install

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

## 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.2.0 |
| Published | 2019-06-05 |
| First published | 2019-02-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | saltfish666 |

## Links

- npm: https://www.npmjs.com/package/fn-onion
- npm.io page: https://npm.io/package/fn-onion

## Recent versions

- 0.2.0 (latest) — 2019-06-05
- 0.1.0 — 2019-02-13

## README

# fn-onion
compose functions to one which will be excuted like onion.
re-factor from koajs/compose so that you can custom args.

``` bash
$ npm i fn-onion
```
``` js
const compose = require('fn-onion')

let middleware = []
middleware[0] = async (next) => {
  await console.log(1)
  await next()
  await console.log(4)
}
middleware[1] = async (next) => {
  await next()
  await console.log(3)
}
middleware[2] = async (next) => {
  await console.log(2)
}

let fn = compose(middleware)
fn()
// 1 2 3 4
```

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