package
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. Maintains compatability with deque.
npm install denqueGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
29.6 kB
Includes dependencies.
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
Install the package:
npm install denqueCreate and consume a queue:
const Denque = require("denque");
const denque = new Denque([1,2,3,4]);
denque.shift(); // 1
denque.pop(); // 4See the API reference documentation for more examples.
... and many more.
Built and maintained by Invertase.