# spex

> Specialized Promise Extensions

Latest version **4.1.0** (published 2025-11-11) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2025-11-11 |
| First published | 2015-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 59.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Author | Vitaly Tomilov |
| Maintainers | vitaly.tomilov |
| Keywords | promise, throttle, throttling, load balancing |

## Links

- npm: https://www.npmjs.com/package/spex
- Repository: https://github.com/vitaly-t/spex
- Issues: https://github.com/vitaly-t/spex/issues
- npm.io page: https://npm.io/package/spex

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 4.1.0 (latest) — 2025-11-11
- 4.1.0-beta.1 (beta) — 2026-01-31
- 4.0.2 — 2025-08-31
- 4.0.1 — 2025-08-29
- 4.0.0 — 2025-08-29
- 3.4.2 — 2025-08-27
- 3.4.1 — 2025-03-21
- 3.4.0 — 2024-10-13
- 3.3.0 — 2023-03-18
- 3.2.0 — 2020-12-20
- 3.1.0 — 2020-12-20
- 3.0.2 — 2020-06-24
- 3.0.1 — 2020-02-02
- 3.0.0 — 2019-08-27
- 2.2.0 — 2019-03-09
- … 97 more at https://npm.io/package/spex/versions

## README

SPEX
----

Specialized Promise Extensions.

[![Build Status](https://github.com/vitaly-t/spex/actions/workflows/ci.yml/badge.svg)](https://github.com/vitaly-t/spex/actions/workflows/ci.yml)
[![Node Version](https://img.shields.io/badge/nodejs-18%20--%2024-green.svg?logo=node.js&style=flat)](https://nodejs.org)

[batch], [page], [sequence] - promise methods for the following patterns:
* [Data Throttling & Load Balancing](http://vitaly-t.github.io/spex/tutorial-throttling.html)
* [Linked and Detached Sequencing](http://vitaly-t.github.io/spex/tutorial-sequencing.html)
* [Streaming and Paging](http://vitaly-t.github.io/spex/tutorial-streaming.html)
* [Batch Processing](http://vitaly-t.github.io/spex/tutorial-batch.html)

## Installing

```
$ npm i spex
```

## Usage

```ts
import {batch, errors} from 'spex';

await batch([1, 2, 3])
    .catch((err: errors.BatchError) => {
    });
```

See also: [client-side usage](http://vitaly-t.github.io/spex/tutorial-client.html).

## API

* [Module]
* Methods
  - [batch] 
  - [page]
  - [sequence]
  - [stream](http://vitaly-t.github.io/spex/stream.html)
    - [read]

## Testing

* Clone the repository (or download, if you prefer):

```
$ git clone https://github.com/vitaly-t/spex
```

* Install the library's DEV dependencies:

```
$ npm install
```

* To run all tests:

```
$ npm test
```

* To run all tests with coverage:

```
$ npm run coverage
```

## License

Copyright © 2025 [Vitaly Tomilov](https://github.com/vitaly-t);
Released under the MIT license.

[Module]:http://vitaly-t.github.io/spex/index.html
[batch]:http://vitaly-t.github.io/spex/global.html#batch
[page]:http://vitaly-t.github.io/spex/global.html#page
[sequence]:http://vitaly-t.github.io/spex/global.html#sequence
[read]:http://vitaly-t.github.io/spex/stream.html#.read
[Promises/A+]:https://promisesaplus.com/
[Promise]:https://github.com/then/promise
[Bluebird]:https://github.com/petkaantonov/bluebird
[When]:https://github.com/cujojs/when
[Q]:https://github.com/kriskowal/q
[RSVP]:https://github.com/tildeio/rsvp.js

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