# queue-ds

> A simple queue data structure.

Latest version **1.0.0** (published 2016-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install queue-ds
pnpm add queue-ds
yarn add queue-ds
bun add queue-ds
```

## 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.0 |
| Published | 2016-09-24 |
| First published | 2016-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Skevos Papamichail |
| Maintainers | skpapam |
| Keywords | queue, data structures |

## Links

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

## 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.0 (latest) — 2016-09-24

## README

# stack-ds

A simple queue data structure.

## Installation

```bash
	npm install queue-ds -save
```

## API 


* **Queue()** - Constructor `var myqueue = new Queue();`

* **Queue.isQueue(obj)** - Check if obj is Queue. Returns boolean. `Queue.isQueue(myobject);`  

* **.enqueue(obj)** - Enqueue an element. Returns this. `myqueue.enqueue({a:5});`

* **.dequeue()** - Dequeue element. Returns the enqueued object `myqueue.dequeue();`

* **.peek()** - Get the next element in queue. `var elem = myqueue.peek();`

* **.size()** - Get the size of the queue. `var size = myqueue.size();`

* **.isEmpty()** - Check if the queue is empty. Returns boolean. `myqueue.isEmpty();`

* **.setMaxSize(max_size)** - Set the maximum size of the queue. Returns this. `myqueue.setMaxtSize(10);`

* **.getMaxSize()** - Get the maximum size of the queue. `myqueue.getMaxtSize();`

* **.empty()** - Empty the queue. Returns this. `myqueue.empty();`

* **.isFull()** - Check if the queue is full. Returns boolean. `myqueue.isEmpty();`

* **.copy(other)** - Copies other into this. Returns this. `myqueue.copy(otherqueue);`

* **.compare(other)** - Compares other and this. Returns boolean. `myqueue.compare(otherqueue);`

* **.toString(debug)** - Export a string representation of the queue If debug is set to true will export a full representation for each element `myqueue.toString();`

* **.toArray()** - Exports an array with queue's data. `myqueue.toArray();`

## TEST

In order to test the library run : 

```bash
	npm test
```

**You need to have mocha installed**

```bash
	npm install -g mocha
```

## LICENSE 
MIT

Copyright (c) 2016 Skevos Papamichail &lt;contact@skevosp.me&gt; (www.skevosp.me)

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