# asyncpipe

> Compose asynchronous functions

Latest version **1.0.0** (published 2017-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install asyncpipe
pnpm add asyncpipe
yarn add asyncpipe
bun add asyncpipe
```

## 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.0 |
| Published | 2017-11-22 |
| First published | 2017-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Faraz Syed |
| Maintainers | hifaraz |
| Keywords | async, functional, composition, pipe, flow, functions, control |

## Links

- npm: https://www.npmjs.com/package/asyncpipe
- Repository: https://github.com/HiFaraz/asyncpipe
- Homepage: https://github.com/HiFaraz/asyncpipe#readme
- Issues: https://github.com/HiFaraz/asyncpipe/issues
- npm.io page: https://npm.io/package/asyncpipe

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-11-22
- 0.1.0 — 2017-01-22
- 0.0.0 — 2017-01-21

## README

# asyncpipe

Compose asynchronous functions in JavaScript

[![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
[![Maintainability][maintainability-image]][maintainability-url]

`asyncpipe` composes asynchronous functions, a perfect fit for functional
programming with Promises or `async`/`await`. It was inspired by `lodash.flow`,
which is excellent but does not support functions that return Promises.

# Is this production ready?

Yes. This module:

* [is small](lib/index.js)
* [is tested with continuous integration](test)
* [works on Node.js v4+](.travis.yml)
* does not need to be built/transpiled
* [does not have any production dependencies](package.json)

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
$ npm install asyncpipe
```

## API

```js
var asyncpipe = require('asyncpipe');
```

### asyncpipe(func1, func2, ...)

Compose an asynchronous function from the series of input arguments (`func1`,
`func2`, ...).

Any error thrown within the series of async functions will be thrown by the
composed function.

## Example

```js
const asyncpipe = require('asyncpipe');

(async () => {
  const a = x => x + 1;
  const b = x => Promise.resolve(x * 2);
  const c = async x => {
    await someExternalService(x);
    return x;
  };

  const result = await asyncpipe(a, b, c)(99);
  console.log(result); // PRINTS: 200
})();
```

[npm-image]: https://img.shields.io/npm/v/asyncpipe.svg
[npm-url]: https://npmjs.org/package/asyncpipe
[travis-image]: https://travis-ci.org/HiFaraz/asyncpipe.svg?branch=master
[travis-url]: https://travis-ci.org/HiFaraz/asyncpipe
[maintainability-image]: https://api.codeclimate.com/v1/badges/c7e61e4de474c6b264dc/maintainability
[maintainability-url]: https://codeclimate.com/github/HiFaraz/asyncpipe/maintainability

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