# sequencing

> Generic middleware pattern for sequential operations.

Latest version **1.0.3** (published 2020-06-03) · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2020-06-03 |
| First published | 2014-11-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Chubbs |
| Maintainers | davidchubbs |
| Keywords | middleware, sequence, design patterns, express, connect |

## Links

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

## 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

- 1.0.3 (latest) — 2020-06-03
- 1.0.2 — 2014-11-22
- 1.0.1 — 2014-11-01
- 1.0.0 — 2014-11-01
- 0.1.0 — 2014-11-01

## README

Sequencing
==========

Sequencing is a generic middleware pattern for sequential operations.

### Install

```bash
npm i sequencing
```

### Example

```js
const createSeq = require('sequencing')

const seq = createSeq()

// set up middleware logic

seq.use((context, next) => {
  console.log(context)           // {name: 'Julie'}
  next(null, { name: 'Jacob' })  // can change the context of the next middleware
})

seq.use((context, next) => {
  console.log(context)           // {name: 'Jacob'}
  next(new Error('uh oh'), context)  // set error
})

seq.useOnError((err, context) => {
  console.log(err)       // [Error: uh oh]
  console.log(context)   // {name: 'Jacob'}
})

// trigger an event for middleware to process

seq.fire({ name: 'Julie' })
```

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