# promise-priority-queue

> A promisified bucket priority queue written in Typescript with no external dependencies.

Latest version **6.0.4** (published 2022-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-priority-queue
pnpm add promise-priority-queue
yarn add promise-priority-queue
bun add promise-priority-queue
```

## Health

**Score 40/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.0.4 |
| Published | 2022-04-03 |
| First published | 2019-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=5 |
| Dependencies | 0 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Jørgen Grimnes |
| Maintainers | jorgenkg |
| Keywords | priority queue, promise queue, promisified queue, bucket queue |

## Links

- npm: https://www.npmjs.com/package/promise-priority-queue
- Repository: https://github.com/jorgenkg/promise-priority-queue
- Homepage: https://github.com/jorgenkg/promise-priority-queue#readme
- Issues: https://github.com/jorgenkg/promise-priority-queue/issues
- npm.io page: https://npm.io/package/promise-priority-queue

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 6.0.4 (latest) — 2022-04-03
- 6.0.3 — 2022-02-07
- 6.0.0 — 2021-12-30
- 5.1.0 — 2021-12-28
- 5.0.1 — 2021-07-24
- 5.0.0 — 2021-07-15
- 4.0.0 — 2021-07-15
- 3.0.0 — 2021-07-15
- 2.0.1 — 2020-07-15
- 2.0.0 — 2020-07-14
- 1.0.2 — 2020-07-14
- 1.0.1 — 2019-07-12
- 1.0.0 — 2019-07-12

## README

# Promise Priority Queue

A promisified bucket priority queue written in Typescript with no external dependencies. 

## Requirements

* `node >= 5.0`

## Installation

```bash
npm i -S promise-priority-queue
```

## Usage

```typescript
import PromiseQueue from 'promise-priority-queue';

const concurrency = 10;
const queue = new PromiseQueue({ concurrency /** optional */ });
const priority = 1;
const task = async (): number => {
  // do work
  return 1;
};

const result: number = await queue.addTask( priority, task ); // resolves with the task result
```


## API

#### [Documentation is available here](https://jorgenkg.github.io/promise-priority-queue/)

Deep link to the [PromiseQueue class](https://jorgenkg.github.io/promise-priority-queue/classes/lib_PromiseQueue.PromiseQueue.html)

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