Registry / devops / inter-mediator-queue

inter-mediator-queue

JSON →
library1.0.9jsnpmunverified

The queue module of INTER-Mediator core, version 1.0.9. Provides a simple FIFO queue implementation for use within the INTER-Mediator framework. It is actively maintained with regular updates on GitHub. The package is lightweight and designed for internal queue management, not intended as a general-purpose queue library.

npm install inter-mediator-queue
INSTALL
IMPORT
SIG · INTER-MEDIATOR-QUE
I
inter-mediator-queue
devopsjavascriptv1.0.9
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 'inter-mediator-queue'
const Queue = require('inter-mediator-queue')
ESM only since v1.0.0
QueueItem
import { QueueItem } from 'inter-mediator-queue'
const { QueueItem } = require('inter-mediator-queue')
Type import available for TypeScript

Create a queue, enqueue and dequeue items, check length and emptiness.

import Queue from 'inter-mediator-queue'; const queue = new Queue(); queue.enqueue({ id: 1, data: 'test' }); console.log(queue.length); // 1 const item = queue.dequeue(); console.log(item); // { id: 1, data: 'test' } console.log(queue.isEmpty()); // true
Debug
Known issues
gotchaQueue is not thread-safe.
fix
Use external synchronisation if using multiple Node.js worker threads.
affects: >=1.0.0
gotchaDefault export is the Queue constructor, not a named export.
fix
Use import Queue from 'inter-mediator-queue' instead of import { Queue }.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'inter-mediator-queue'
Package not installed or not in node_modules.
fix
Run npm install inter-mediator-queue
TypeError: inter-mediator-queue_1.default is not a constructor
Using default import incorrectly when using CommonJS.
fix
Use import Queue from 'inter-mediator-queue' with ESM or const Queue = require('inter-mediator-queue').default if mixing.
Upgrade
Version history
1.0.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
inter-mediator-queue — npm install inter-mediator-queue · libregistry