Registry / storage / dequeue

dequeue

JSON →
library1.0.5jsnpmunverified

A simple double-ended queue datastructure for Node.js, version 1.0.5 (last released in 2013). Provides O(1) push, pop, shift, and unshift operations, making it a drop-in replacement for JavaScript arrays used as FIFO queues. Avoids performance degradation seen with large arrays (100k+ entries) by using a linked list internally. Lightweight, no dependencies, and supports Node.js engines of all versions.

storage
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package uses CommonJS; no ESM support. Default export is the constructor.

const Dequeue = require('dequeue')

Named import will fail; package does not export named symbols.

import Dequeue from 'dequeue'

module.exports is the constructor directly, not an object.

var Dequeue = require('dequeue').Dequeue

Creates a dequeue, adds elements with push and unshift, then removes from both ends using shift and pop.

const Dequeue = require('dequeue'); const fifo = new Dequeue(); fifo.push('first'); fifo.push('second'); fifo.unshift('zeroth'); console.log(fifo.length); // 3 console.log(fifo.shift()); // zeroth console.log(fifo.pop()); // second console.log(fifo.shift()); // first console.log(fifo.length); // 0
Debug
Known footguns
gotchaNo TypeScript typings available; manual type definitions required for TS projects.
gotchaPackage uses CommonJS; not compatible with ES module import syntax in Node.js without bundling or --experimental-require-module.
gotchaThe package has not been updated since 2013; may have unpatched vulnerabilities or compatibility issues with modern Node.js.
deprecatedThe package is unmaintained; no new features or bug fixes are expected.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
16 hits · last 30 days
gptbot
3
amazonbot
3
dotbot
1
ahrefsbot
1
Resources