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. Maintains compatability with deque.

Apache-2.0 24 个版本
安装
npm install denque
yarn add denque
pnpm add denque
bun add denque
README

Denque

NPM downloads NPM version Tests status Coverage License Follow on Twitter

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?

... and many more.


License


Built and maintained by Invertase.

版本列表
2.1.0 2022-07-18
2.0.1 2021-08-31
2.0.0 2021-08-18
1.5.1 2021-08-18
1.5.0 2021-01-04
1.4.1 2019-04-03
1.4.0 2018-11-10
1.3.0 2018-06-03
1.2.6 2018-05-24
1.2.5 2018-05-24
1.2.4 2018-05-24
1.2.3 2018-02-09
1.2.2 2017-08-15
1.2.1 2017-07-28
1.2.0 2017-07-28
1.1.1 2017-01-26
1.1.0 2016-10-17
1.0.6 2016-10-17
1.0.5 2016-10-17
1.0.4 2016-09-16
1.0.3 2016-09-01
1.0.2 2016-08-26
1.0.1 2016-07-02
1.0.0 2016-07-02