Registry / storage / ss-queue

ss-queue

JSON →
library1.0.5jsnpmunverified

A TypeScript-based queue data structure implemented using a singly-linked list. Current stable version is 1.0.5. Fully tested with no known active development since 2020. Differentiator: lightweight, no dependencies, supports UMD for browser usage. Suitable for scenarios needing a simple FIFO queue with TypeScript type safety.

npm install ss-queue
INSTALL
IMPORT
SIG · SS-QUEUE
S
ss-queue
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.

Queue
import Queue from 'ss-queue'
import { Queue } from 'ss-queue'
Default export; named import will not work.
Queue
const Queue = require('ss-queue')
const { Queue } = require('ss-queue')
CommonJS require returns the default export directly, not an object with Queue property.
QueueType
import type { IQueue } from 'ss-queue'
TypeScript type for the Queue interface; exported as IQueue.

Creates a queue, enqueues two elements, dequeues one, checks size and emptiness, then clears the queue.

import Queue from 'ss-queue'; const queue = new Queue<number>(); queue.enqueue(1); queue.enqueue(2); console.log(queue.dequeue()); // 1 console.log(queue.size()); // 1 console.log(queue.isEmpty()); // false queue.clear(); console.log(queue.isEmpty()); // true
Debug
Known issues
gotchaQueue.dequeue() returns undefined if queue is empty (not throwing an error). Make sure to check isEmpty() before calling dequeue.
fix
Always check queue.isEmpty() before dequeue or use optional chaining.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Queue is not a constructor
Using named import instead of default import.
fix
Use `import Queue from 'ss-queue'` (default import) instead of `import { Queue } from 'ss-queue'`.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
ss-queue — npm install ss-queue · libregistry