Denque
The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries.
Install / Use
/learn @invertase/DenqueREADME
Denque is a well tested, extremely fast and lightweight double-ended queue implementation with zero dependencies and includes TypeScript types.
Double-ended queues can also be used as a:
This implementation is currently the fastest available, even faster than double-ended-queue, see the benchmarks.
Every queue operation is done at a constant O(1) - including random access from .peekAt(index).
Works on all node versions >= v0.10
Quick Start
Install the package:
npm install denque
Create and consume a queue:
const Denque = require("denque");
const denque = new Denque([1,2,3,4]);
denque.shift(); // 1
denque.pop(); // 4
See the API reference documentation for more examples.
Who's using it?
- Kafka Node.js client
- MariaDB Node.js client
- MongoDB Node.js client
- MySQL Node.js client
- Redis Node.js clients
... and many more.
License
- See LICENSE
<p align="center"> <a href="https://invertase.io/?utm_source=readme&utm_medium=footer&utm_campaign=denque"> <img width="75px" src="https://static.invertase.io/assets/invertase/invertase-rounded-avatar.png"> </a> <p align="center"> Built and maintained by <a href="https://invertase.io/?utm_source=readme&utm_medium=footer&utm_campaign=denque">Invertase</a>. </p> </p>
Related Skills
feishu-drive
344.4k|
things-mac
344.4kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
344.4kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
postkit
PostgreSQL-native identity, configuration, metering, and job queues. SQL functions that work with any language or driver
