# @style/http-queue

> A fire-and-forget HTTP request queue implementation for browsers.

Latest version **3.2.0** (published 2019-05-29) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @style/http-queue
pnpm add @style/http-queue
yarn add @style/http-queue
bun add @style/http-queue
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2019-05-29 |
| First published | 2016-07-25 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | ^10.0.0 |
| Dependencies | 6 |
| Unpacked size | 35.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | StyleLounge GmbH |
| Maintainers | ansgars, brofori, chin2km, dpommeranz, figedi, freemountain, lorenzo-fossati-sl, peter.gruenberg, plazma, rodelarivera, samnajian, sl-bot |

## Links

- npm: https://www.npmjs.com/package/@style/http-queue
- Repository: https://github.com/StyleLounge/http-queue
- Homepage: https://github.com/StyleLounge/http-queue#readme
- Issues: https://github.com/StyleLounge/http-queue/issues
- npm.io page: https://npm.io/package/@style/http-queue

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [redux](https://npm.io/package/redux.md) ^4.0.1
- [basil.js](https://npm.io/package/basil.js.md) ^0.4.10
- [redux-saga](https://npm.io/package/redux-saga.md) ^1.0.2
- [redux-actions](https://npm.io/package/redux-actions.md) ^2.6.5
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1

## Recent versions

- 3.2.0 (latest) — 2019-05-29
- 3.3.0-beta.4 (beta) — 2019-05-29
- 3.3.0-beta.3 — 2019-05-29
- 3.3.0-beta.2 — 2019-05-29
- 3.3.0-beta.1 — 2019-05-29
- 3.2.0-beta.0 — 2019-05-29
- 3.1.4 — 2018-05-11
- 3.1.4-beta.2 — 2018-05-11
- 3.1.4-beta.1 — 2018-05-11
- 3.1.4-beta.0 — 2018-05-09
- 3.1.3 — 2018-05-09
- 3.1.2 — 2018-05-09
- 3.1.1 — 2018-05-09
- 3.0.0 — 2017-08-17
- 2.0.2 — 2017-01-11
- … 6 more at https://npm.io/package/@style/http-queue/versions

## README

# @style/http-queue [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) [![wercker status](https://app.wercker.com/status/fdcda89323df1030a7581504bef3c4ad/s "wercker status")](https://app.wercker.com/project/bykey/fdcda89323df1030a7581504bef3c4ad)

A fire-and-forget HTTP request queue implementation for browsers.

## Installation

```sh
npm i --save @style/http-queue
```

## Usage example

```js
import queue from '@style/http-queue';

async () => {
    const { schedule, drain } = queue();

    // Schedule some HTTP requests
    schedule({verb: 'POST', url: 'http://analytics.stylelounge.de', data: {character: 'Almec'}});
    schedule({verb: 'POST', url: 'http://analytics.stylelounge.de', data: {character: 'Amee'}});
    schedule({verb: 'POST', url: 'http://analytics.stylelounge.de', data: {character: 'Darth Bane'}});
    schedule({verb: 'POST', url: 'http://analytics.stylelounge.de', data: {character: 'Beed'}});
    schedule({verb: 'POST', url: 'http://analytics.stylelounge.de', data: {character: 'Sio Bibble'}});
    schedule({verb: 'POST', url: 'http://analytics.stylelounge.de', data: {character: 'Dengar'}});
    schedule({verb: 'POST', url: 'http://analytics.stylelounge.de', data: {character: 'Feral'}});

    // Let's drain the queue ("waits" until all requests has been sent OR terminates after configurable
    // timeout; default = 3000 ms)
    await drain();
};
```

## Debugging

The library uses the [debug](https://github.com/visionmedia/debug) library internally. You can activate the debug messages by executing the following in your console:

```js
localStorage.debug = '@stylelounge/http-queue:*';
```

## Development

### Available `npm scripts`

| *name* | *description* |
|---|---|
| `npm run build`  | Creates a clean build of this library (installs all `npm packages`, the TS typings and compiles everything). |
| `npm run lint` | Lints the TS code via `tslint`. |
| `npm run test` (a.k.a. `npm test`) | Performs all the tests within the project. |

### Semantic commit messages

This project follows a pattern, called [semantic commit messages](https://seesparkbox.com/foundry/semantic_commit_messages). By using this convention it is possible to infer the next version number based on the last commit messages when creating a new release.

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