# react-fifo

> ``` Queue data structure as npm package This package helps you to simulate the behaviour of a queue. If you are familiar with c++ queues this has exactly same methods. ```

Latest version **1.3.4** (published 2021-07-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-fifo
pnpm add react-fifo
yarn add react-fifo
bun add react-fifo
```

## 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.3.4 |
| Published | 2021-07-22 |
| First published | 2021-07-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Talha shamim |
| Maintainers | talhashamim |
| Keywords | queue, react-queue, fifo, react-fifo, queue data structure |

## Links

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

## 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.3.4 (latest) — 2021-07-22
- 1.3.3 — 2021-07-22
- 1.3.2 — 2021-07-22
- 1.3.1 — 2021-07-22
- 1.3.0 — 2021-07-22
- 1.2.0 — 2021-07-22
- 1.1.2 — 2021-07-19
- 1.1.1 — 2021-07-19
- 1.1.0 — 2021-07-19
- 1.0.0 — 2021-07-19

## README

# What is this ?

```
Queue data structure as npm package
This package helps you to simulate the behaviour of a queue.
If you are familiar with c++ queues this has exactly same methods.
```

# Installation 
`npm i react-fifo`


# Methods 

### Push
`Use - For inserting/pushing data to queue 
if you want to push say 1,2,3`
```
        queue.push(1)
        queue.push(2)
        queue.push(3)
```

### Pop
`Use - For removing data from queue `
```
        queue.pop()
This is follow the property of queue and pop the front element
If there are no element it returns -1 and if popped will return 1
```

### Size
`Use - To get the current size of the queue`
```
        queue.size()
```

### Empty
`Use - To check if the queue is empty or not`
```
        queue.isEmpty()
```

### Front
`Use - To get the front element of the queue`
```
        queue.front()
This returns "empty" if queue is empty else returns the element
```

# Example 
### Showing adding 4 elements, printing and removing all
```
const queue = require('react-fifo');

queue.push(1);
queue.push(2);
queue.push(3);
queue.push(4);

while(!queue.isEmpty()){
    console.log(queue.front());
    queue.pop();
}
```

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