# @celeri/middleware-pipeline

> A generic library for creating middleware pipelines

Latest version **2.1.1** (published 2021-01-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install @celeri/middleware-pipeline
pnpm add @celeri/middleware-pipeline
yarn add @celeri/middleware-pipeline
bun add @celeri/middleware-pipeline
```

## 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 | 2.1.1 |
| Published | 2021-01-06 |
| First published | 2017-05-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Brumond |
| Maintainers | celeri |
| Keywords | celeri, middleware, async |

## Links

- npm: https://www.npmjs.com/package/@celeri/middleware-pipeline
- Repository: https://github.com/celeri-server/middleware-pipeline
- Homepage: https://github.com/celeri-server/middleware-pipeline#readme
- Issues: https://github.com/celeri-server/middleware-pipeline/issues
- npm.io page: https://npm.io/package/@celeri/middleware-pipeline

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2021-01-06
- 2.1.0 — 2021-01-06
- 2.0.5 — 2019-03-31
- 2.0.4 — 2019-03-20
- 2.0.3 — 2019-03-20
- 2.0.2 — 2019-03-20
- 2.0.1 — 2019-03-20
- 2.0.0 — 2019-03-20
- 1.0.5 — 2017-05-06
- 1.0.4 — 2017-05-05
- 1.0.3 — 2017-05-05
- 1.0.2 — 2017-05-02
- 1.0.1 — 2017-05-02
- 1.0.0 — 2017-05-01

## README

```bash
$ npm install --save @celeri/middleware-pipeline
```



### Import

#### ES6 Modules

```javascript
import { MiddlewarePipeline } from '@celeri/middleware-pipeline';
```

#### CommonJS Modules

```javascript
const { MiddlewarePipeline } = require('@celeri/middleware-pipeline');
```



### Usage

```javascript
const pipieline = new MiddlewarePipeline();

pipeline
	// Middlewares can be async functions to be awaited
	.use(async (url) => await httpGet(url))
	// Or they can be normal functions
	.use((body) => JSON.parse(body))
	// Error handling middleware can be placed with catch
	.catch({ error } => console.error(error))
	// A catch implies that the error was handled (unless it also throws),
	// so following middleware will still run
	.use(() => {
		// This runs regardless of whether the first two steps passed
	});

pipeline.run('http://www.example.com');
```

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