# @fofx/queue

> Pure node implementation of a local/distributed queue

Latest version **2.0.1** (published 2019-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fofx/queue
pnpm add @fofx/queue
yarn add @fofx/queue
bun add @fofx/queue
```

## 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.0.1 |
| Published | 2019-04-18 |
| First published | 2019-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | oakfang |
| Maintainers | oakfang |

## Links

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

## Dependencies (3)

- [ws](https://npm.io/package/ws.md) ^6.2.1
- [uuid](https://npm.io/package/uuid.md) ^3.3.2
- [json-error](https://npm.io/package/json-error.md) ^1.1.1

## Recent versions

- 2.0.1 (latest) — 2019-04-18
- 2.0.0 — 2019-04-18
- 1.1.1 — 2019-04-15
- 1.1.0 — 2019-04-15
- 1.0.0 — 2019-04-15

## README

# queue

Pure node implementation of a distributed queue

## Usage

```js
// broker.js
const { startQueueBroker } = require('@fofx/queue').distributed;
const { add } = startQueueBroker(9000);
add({ x: 1, y: 2 }).then(value => console.log(value));
```

```js
// worker.js
const { startQueueWorker } = require('@fofx/queue').distributed;
const worker = startQueueWorker('ws://localhost:9000');
worker.register(async function add({ x, y }) {
  const constant = await worker.get('const', 0);
  const value = x + y + constant;
  await worker.set('const', value);
  return x + y;
});
```

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