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.

npm install dequeue
INSTALL
IMPORT
SIG · DEQUEUE
D
dequeue
storagejavascriptv1.0.5
harness data pending
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.

Dequeue
const Dequeue = require('dequeue')
import Dequeue from 'dequeue'
Package uses CommonJS; no ESM support. Default export is the constructor.
Dequeue
import Dequeue from 'dequeue'
import { Dequeue } from 'dequeue'
Named import will fail; package does not export named symbols.
Dequeue
var Dequeue = require('dequeue').Dequeue
var Dequeue = require('dequeue').default
module.exports is the constructor directly, not an object.

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 issues
gotchaNo TypeScript typings available; manual type definitions required for TS projects.
fix
Create a .d.ts file or use @types/dequeue if available.
affects: >=1.0.0
gotchaPackage uses CommonJS; not compatible with ES module import syntax in Node.js without bundling or --experimental-require-module.
fix
Use require() instead of import or use a bundler like webpack.
affects: >=1.0.0
gotchaThe package has not been updated since 2013; may have unpatched vulnerabilities or compatibility issues with modern Node.js.
fix
Consider using alternatives like 'denque' or 'double-ended-queue' for active maintenance.
affects: >=1.0.0
deprecatedThe package is unmaintained; no new features or bug fixes are expected.
fix
Evaluate migration to a maintained library such as 'denque'.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'dequeue'
Package not installed or not in node_modules.
fix
Run: npm install dequeue
The term 'Dequeue' is not recognized as a cmdlet, function, script file, or operable program.
Trying to run dequeue as a command-line tool.
fix
This is a library, not a CLI. Use require('dequeue') in your Node.js code.
Uncaught TypeError: Dequeue is not a constructor
Using import { Dequeue } instead of default import or require.
fix
Use: const Dequeue = require('dequeue') or import Dequeue from 'dequeue' (with bundler support).
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
30
Resources
dequeue — npm install dequeue · libregistry