# restqueue

> Simple REST interface to an queue/array, for distributed push/pop purposes

Latest version **1.0.11** (published 2016-10-03) · ISC license · 0 weekly downloads

## Install

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

## 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 | 1.0.11 |
| Published | 2016-10-03 |
| First published | 2016-10-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | coderofsalvation |
| Keywords | queue, restful, distributed, simple, rest, api |

## Links

- npm: https://www.npmjs.com/package/restqueue
- npm.io page: https://npm.io/package/restqueue

## Dependencies (3)

- [flowee](https://npm.io/package/flowee.md) ^1.0.32
- [flowee-doc](https://npm.io/package/flowee-doc.md) ^1.0.3
- [body-parser](https://npm.io/package/body-parser.md) ^1.15.2

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

- 1.0.11 (latest) — 2016-10-03
- 1.0.1 — 2016-10-03

## README

Simple in-memory (or nedb- mysql- mongodb) queue using REST calls

## Usage 

Put this in `server.js`:

    var restqueue = require('./index.js')

    restqueue([
      'myqueue', 
      'anotherqueue'
    ], function(app, server){
      console.log("queue started at port "+process.env.PORT )
    })

And then run

    $ PORT=4444 node server.js

> Voila: now each queue has api-endpoints. The documentation/playground can be viewed at 'http://localhost:4444/doc/#!/default'

<img src="https://github.com/coderofsalvation/restqueue/raw/master/doc/restqueue.png" width="60%"/>

## Rest calls 

    $ curl -H 'Content-Type: application/json' -X POST http://localhost:4444/q/myqueue --data '{"data":{"foo":"bar"}}'
    {"jsonapi":{"version":"1.0"}, "errors":[], "data":{"status":"pushed"}}

    $ curl -X GET http://localhost:4444/q/myqueue
    {"jsonapi":{"version":"1.0"}, "errors":[], "data":{"foo":"bar"}}

## Why

I tried [rsmq](https://npmjs.org/package/rsmq) and [kue](https://npmjs.org/package/kue) as nodejs-queues, but wondered why redisdb was needed.
This is an REST + nodejs approach, simply using arrays.
For a more serious distributed queue i would suggest rabbitmq,  and for an single-process async queue i would suggest [queue](https://npmjs.org/package/queue)

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