# @f/compose

> Right-to-left function composition for two or more functions

Latest version **1.0.1** (published 2016-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/compose
pnpm add @f/compose
yarn add @f/compose
bun add @f/compose
```

## 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.1 |
| Published | 2016-02-23 |
| First published | 2016-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/compose
- Repository: https://github.com/micro-js/compose
- Homepage: https://github.com/micro-js/compose#readme
- Issues: https://github.com/micro-js/compose/issues
- npm.io page: https://npm.io/package/@f/compose

## Dependencies (2)

- [@f/identity](https://npm.io/package/@f/identity.md) ^1.1.1
- [@f/reduce-array](https://npm.io/package/@f/reduce-array.md) ^0.2.1

## Recent versions

- 1.0.1 (latest) — 2016-02-23
- 1.0.0 — 2016-01-17
- 0.1.4 — 2016-01-17
- 0.1.2 — 2016-01-10
- 0.1.1 — 2016-01-10
- 0.1.0 — 2016-01-07

## README

# compose

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Right-to-left function composition for two or more functions.

![Function Composition](./composition.png)

## What is it?

If you aren't familiar with function composition you can read all about it [here](http://scott.sauyet.com/Javascript/Talk/Compose/2013-05-22/#slide-0).

## Installation

    $ npm install @f/compose

## Usage

```js
var compose = require('@f/compose')

var times2plus1 = compose(plus1, times2)
// times2plus1(3) -> 7

function plus1 (x) {
  return x + 1
}

function times2 (x) {
  return x * 2
}
```

## API

### compose(...fns)

- `fns` - List of functions to compose

**Returns:** A new function which when called with arguments, pipes those through `fns` from right-to-left

## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/compose.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/compose
[git-image]: https://img.shields.io/github/tag/micro-js/compose.svg?style=flat-square
[git-url]: https://github.com/micro-js/compose
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/compose.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/compose

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