# smart-cq

> A priority queue with configurable retry and concurrency

Latest version **0.0.3** (published 2018-11-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install smart-cq
pnpm add smart-cq
yarn add smart-cq
bun add smart-cq
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-11-01 |
| First published | 2018-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.3 |
| Dependencies | 2 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Shaun Warman |
| Maintainers | shaunwarman |
| Keywords | queue, task, priorityqueue |

## Links

- npm: https://www.npmjs.com/package/smart-cq
- Repository: https://github.com/shaunwarman/smart-queue
- Issues: https://github.com/shaunwarman/smart-queue/issues
- npm.io page: https://npm.io/package/smart-cq

## Dependencies (2)

- [p-queue](https://npm.io/package/p-queue.md) ^3.0.0
- [p-retry](https://npm.io/package/p-retry.md) ^2.0.0

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

- 0.0.3 (latest) — 2018-11-01
- 0.0.2 — 2018-10-31
- 0.0.1 — 2018-10-24

## README

# concurrent-queue

[![build status](https://img.shields.io/travis/shaunwarman/smart-queue.svg)](https://travis-ci.com/shaunwarman/smart-queue)
[![code coverage](https://img.shields.io/codecov/c/github/shaunwarman/smart-queue.svg)](https://codecov.io/gh/shaunwarman/smart-queue)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
[![license](https://img.shields.io/github/license/shaunwarman/smart-queue.svg)](LICENSE)
[![npm downloads](https://img.shields.io/npm/dt/smart-queue.svg)](https://npm.im/smart-queue)

> A priority queue with configurable retry and concurrency


## Table of Contents

* [Install](#install)
* [Usage](#usage)
* [Options](#options)
* [Contributors](#contributors)
* [License](#license)


## Install

[npm][]:

```sh
npm install smart-cq
```

[yarn][]:

```sh
yarn add smart-cq
```


## Usage

```js
const CQueue = require('smart-cq');

const cqueue = new CQueue({
  concurrency: 10,
  retries: 3
});

const asyncTask = () => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve();
    }, 1000);
  });
}

cqueue.enqueue(asyncTask)
```


## Options

* `concurrency` - (default: `Infinity`) - concurrent tasks to run
* `retries` - (default: `3`) - retry attempts on failed tasks


## Contributors

| Name             | Website                   |
| ---------------- | ------------------------- |
| **Shaun Warman** | <https://shaunwarman.com> |


## License

[MIT](LICENSE) © [Shaun Warman](https://shaunwarman.com)


## 

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

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