Registry / messaging / onirii

onirii

JSON →
library1.3.6jsnpmunverified

Onirii is a universal queue SDK for Node.js that provides a unified interface across multiple message queue providers. Version 1.3.6 is the latest stable release. The library is actively developed with two providers currently supported fully (RabbitMQ and AmazonSQS) and others in progress. It specializes in RabbitMQ confirm channel support and connection management with configurable maximum channel count. Compared to using raw amqplib or AWS SDK, Onirii offers an abstraction layer to switch between providers with minimal code changes.

npm install onirii
INSTALL
IMPORT
SIG · ONIRII
O
onirii
messagingjavascriptv1.3.6
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.

default
import Onirii from 'onirii'
const Onirii = require('onirii')
ESM-only package; CommonJS require is not supported.
Queue
import { Queue } from 'onirii'
Named export for creating a queue instance.
Message
import { Message } from 'onirii'
import { Message } from 'onirii/message'
Named export; no subpath export exists.
Exchange
import { Exchange } from 'onirii'
Named export for exchange operations.
Permission
import { Permission } from 'onirii'
import { Permissions } from 'onirii'
Singular 'Permission', not plural.

Connects to RabbitMQ, creates a confirm channel, declares a queue and exchange, binds them, publishes a message, and consumes messages with acknowledgement. ESM imports are required.

import Onirii from 'onirii'; async function main() { const connection = new Onirii.Connection({ provider: 'rabbitmq', url: 'amqp://guest:guest@localhost:5672', maxChannels: 10 }); const channel = await connection.createChannel(); const queue = channel.queue('my-queue', { durable: true }); const exchange = channel.exchange('my-exchange', 'direct', { durable: true }); await queue.bind(exchange, 'routing-key'); await channel.publish(exchange.name, 'routing-key', Buffer.from('Hello'), { persistent: true }); await channel.consume(queue.name, (msg) => { if (msg) { console.log('Received:', msg.content.toString()); channel.ack(msg); } }); // Keep alive process.on('SIGINT', () => connection.close()); } main().catch(console.error);
Debug
Known issues
breakingVersion 1.3.x dropped support for CommonJS. Only ESM imports are supported.
fix
Switch from require() to import syntax. For TypeScript, ensure module resolution is set to 'node16' or 'nodenext'.
affects: >=1.3.0
deprecatedThe 'TubeMQ' provider is marked as terminated in the README.
fix
Do not use TubeMQ provider; it will not be developed further.
affects: *
gotchaMax channel count is set per connection, but the SDK does not enforce it if the server allows more. Limiting is client-side only.
fix
When setting maxChannels, the SDK will create new channels up to that limit but may exceed if channel is not closed properly. Monitor channel usage manually.
affects: *
gotchaAmazonSQS support is marked as 'Developing'; not all features are complete. The permission and tag features may be partial.
fix
Use RabbitMQ for full feature support. Check the README feature matrix before relying on SQS-specific features.
affects: *
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
The package is ESM-only, but the project is configured for CommonJS.
fix
Add "type": "module" to your package.json, or rename .js files to .mjs. If using TypeScript, set "module": "ESNext" or "Node16" in tsconfig.json.
TypeError: Onirii is not a constructor
Using require('onirii') returns the default export object, not the class. CommonJS does not support default exports natively.
fix
Change to import Onirii from 'onirii' or use dynamic import: const Onirii = (await import('onirii')).default;
Upgrade
Version history
1.3.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
packageonirii
onirii — npm install onirii · libregistry