Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/retraigo/nequeue

A "queue" with various operations.
https://github.com/retraigo/nequeue

Last synced: 8 days ago
JSON representation

A "queue" with various operations.

Awesome Lists containing this project

README

        

# Nequeue
A queue-like wrapper around the JavaScript `array`.

## Properties And methods
- `size` (size of the queue)

Supports the following default Array methods:
- `at()` (now warps on either side of the queue, also removes the item from the array)
- `every()`
- `some()`
- `find()` (also removes the item from the queue)
- `filter()`
- `map()`
- `sort()`
- `pop()` (actually implements `shift()` rn. Use `at(-1)` for the original `pop()`)

Newer methods:
- `add()` (akin to `Array#push`)
- `array()` (read-only access to the private `#data` field)
- `kick()` (get the first element and move it to the last)
- `shuffle()` (sorts the queue in a random order)

## License
MIT as always.

## Support
[https://discord.gg/A69vvdK]