Registry / storage / qlist
library0.14.0jsnpmunverified

qlist is a high-performance double-ended queue (deque), stack, and circular buffer implementation for Node.js. v0.14.0 provides fast O(1) operations for push/pop/shift/unshift and efficient circular buffer operations. It is designed for Node.js environments (any engine), focuses on raw speed and minimal memory overhead, and is authored by Andras. Less feature-rich than alternatives like `double-ended-queue` but optimized for speed in Node.js.

npm install qlist
INSTALL
IMPORT
SIG · QLIST
Q
qlist
storagejavascriptv0.14.0
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.

List
import { List } from 'qlist'
const qlist = require('qlist')
Requires ES module syntax. Named export only.
circularBuffer
import { circularBuffer } from 'qlist'
import circularBuffer from 'qlist'
The circularBuffer function is a named export, not default.
List (default)
const { List } = require('qlist')
const List = require('qlist')
CommonJS works with named destructuring. Do not assign the whole module to List.

Shows basic deque operations (push, shift, pop, unshift) and circular buffer usage with fixed size and overwrite behavior.

import { List } from 'qlist'; const list = new List(); list.push('a'); list.push('b'); list.unshift('first'); console.log(list.shift()); // 'first' console.log(list.pop()); // 'b' console.log(list.toArray()); // ['a'] // circular buffer usage import { circularBuffer } from 'qlist'; const cb = circularBuffer(3); cb.push(1); cb.push(2); cb.push(3); cb.push(4); // overwrites oldest (1) console.log(cb.toArray()); // [2, 3, 4] console.log(cb.get(0)); // 2
Debug
Known issues
gotchaThe library does not export a default export. Attempting to import the whole module as default will result in undefined or an error.
fix
Use named import: import { List } from 'qlist'
affects: >=0.0.0
gotchacircularBuffer returns an object with limited methods. It is not a full List instance.
fix
Only use methods documented for circularBuffer (push, get, toArray). Do not call shift/pop.
affects: >=0.0.0
gotchaThe library is intended for Node.js and may not work in browsers without bundling.
fix
Use a bundler like webpack or esbuild, or avoid code that relies on Node.js specifics.
affects: >=0.0.0
Errors
Common errors & fixes
SyntaxError: Unexpected token 'export'
Using ES module import syntax in a CommonJS module.
fix
Use require: const { List } = require('qlist'); or add 'type': 'module' to package.json.
TypeError: qlist is not a constructor
Assigning the whole module to List instead of destructuring.
fix
Use const { List } = require('qlist'); not const List = require('qlist');
Uncaught TypeError: list.shift is not a function
Using shift() on a circular buffer object that doesn't have that method.
fix
circularBuffer does not support shift/pop; use get() and manual index tracking.
Upgrade
Version history
0.14.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
20
Resources
packageqlist
qlist — npm install qlist · libregistry