# @rayeeskm/queue

> Performant Queue in JS

Latest version **1.0.1** (published 2022-02-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @rayeeskm/queue
pnpm add @rayeeskm/queue
yarn add @rayeeskm/queue
bun add @rayeeskm/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 | 1.0.1 |
| Published | 2022-02-25 |
| First published | 2022-02-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rayees |
| Maintainers | rayeeskm |
| Keywords | queue |

## Links

- npm: https://www.npmjs.com/package/@rayeeskm/queue
- npm.io page: https://npm.io/package/@rayeeskm/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

- 1.0.1 (latest) — 2022-02-25
- 1.0.0 — 2022-02-23

## README

# Simple Performant Queue in JS
The general way of implementing queue in javascript is to utilize the push and shift function on arrays. Though push function is straight forward, shift executes at a cost of rewriting the whole array. the cost becomes pretty evident once the queue size goes upwards of 10000. 

This queue implementation is a simple straight forward mechanism of linking each element in a queue ensuring cost remains O(1)  

# Installation
npm install @rayeeskm/queue

## Usage

    import  Queue  from  '@rayeeskm/queue';
    
    // Create a Queue 
    q = new Queue()
    
    // Add an element to queue
    q.enQ(1)
    
    // Fetch an element from queue
    let val = q.deQ()
    
    // Fetch the element but not remove from queue
    val = q.peek()
    
    // Get the size of the queue
    let size = q.size()

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