denque

Denque

NPM downloadsarrow-up-right NPM versionarrow-up-right Tests statusarrow-up-right Coveragearrow-up-right Licensearrow-up-right Follow on Twitterarrow-up-right

Denque is a well tested, extremely fast and lightweight double-ended queuearrow-up-right 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 benchmarksarrow-up-right.

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 documentationarrow-up-right for more examples.


Who's using it?

... and many morearrow-up-right.


License


arrow-up-right

Built and maintained by Invertasearrow-up-right.

Last updated