{"id":48835,"library":"onirii","title":"Onirii (Universal Queue SDK)","description":"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.","status":"active","version":"1.3.6","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","amqplib","AMQP 0-9-1","RabbitMQ","MQ"],"install":[{"cmd":"npm install onirii","lang":"bash","label":"npm"},{"cmd":"yarn add onirii","lang":"bash","label":"yarn"},{"cmd":"pnpm add onirii","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only package; CommonJS require is not supported.","wrong":"const Onirii = require('onirii')","symbol":"default","correct":"import Onirii from 'onirii'"},{"note":"Named export for creating a queue instance.","wrong":"","symbol":"Queue","correct":"import { Queue } from 'onirii'"},{"note":"Named export; no subpath export exists.","wrong":"import { Message } from 'onirii/message'","symbol":"Message","correct":"import { Message } from 'onirii'"},{"note":"Named export for exchange operations.","wrong":"","symbol":"Exchange","correct":"import { Exchange } from 'onirii'"},{"note":"Singular 'Permission', not plural.","wrong":"import { Permissions } from 'onirii'","symbol":"Permission","correct":"import { Permission } from 'onirii'"}],"quickstart":{"code":"import Onirii from 'onirii';\n\nasync function main() {\n  const connection = new Onirii.Connection({\n    provider: 'rabbitmq',\n    url: 'amqp://guest:guest@localhost:5672',\n    maxChannels: 10\n  });\n\n  const channel = await connection.createChannel();\n  const queue = channel.queue('my-queue', { durable: true });\n  const exchange = channel.exchange('my-exchange', 'direct', { durable: true });\n\n  await queue.bind(exchange, 'routing-key');\n  await channel.publish(exchange.name, 'routing-key', Buffer.from('Hello'), { persistent: true });\n\n  await channel.consume(queue.name, (msg) => {\n    if (msg) {\n      console.log('Received:', msg.content.toString());\n      channel.ack(msg);\n    }\n  });\n\n  // Keep alive\n  process.on('SIGINT', () => connection.close());\n}\n\nmain().catch(console.error);","lang":"typescript","description":"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."},"warnings":[{"fix":"Switch from require() to import syntax. For TypeScript, ensure module resolution is set to 'node16' or 'nodenext'.","message":"Version 1.3.x dropped support for CommonJS. Only ESM imports are supported.","severity":"breaking","affected_versions":">=1.3.0"},{"fix":"Do not use TubeMQ provider; it will not be developed further.","message":"The 'TubeMQ' provider is marked as terminated in the README.","severity":"deprecated","affected_versions":"*"},{"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.","message":"Max channel count is set per connection, but the SDK does not enforce it if the server allows more. Limiting is client-side only.","severity":"gotcha","affected_versions":"*"},{"fix":"Use RabbitMQ for full feature support. Check the README feature matrix before relying on SQS-specific features.","message":"AmazonSQS support is marked as 'Developing'; not all features are complete. The permission and tag features may be partial.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'-1':89 '-9':88 '0':87 '1.3.6':24 'abstract':74 'across':18 'activ':33 'amazonsq':43 'amqp':86 'amqplib':67,85 'aw':69 'chang':83 'channel':53,61 'code':82 'compar':63 'configur':59 'confirm':52 'connect':56 'count':62 'current':38 'develop':34 'fulli':40 'interfac':17 'javascript':84 'latest':27 'layer':75 'librari':31 'manag':57 'maximum':60 'messag':20 'minim':81 'mq':91 'multipl':19 'node.js':12 'offer':72 'onirii':1,5,71 'other':45 'progress':47 'provid':14,22,37,79 'queue':3,9,21 'rabbitmq':41,51,90 'raw':66 'releas':29 'sdk':4,10,70 'special':49 'stabl':28 'support':39,54 'switch':77 'two':36 'unifi':16 'univers':2,8 'use':65 'version':23","created_at":"2026-06-07T16:58:43.534202+00:00","updated_at":"2026-06-07T16:58:43.534202+00:00","problems":[{"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.","cause":"The package is ESM-only, but the project is configured for CommonJS.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Change to import Onirii from 'onirii' or use dynamic import: const Onirii = (await import('onirii')).default;","cause":"Using require('onirii') returns the default export object, not the class. CommonJS does not support default exports natively.","error":"TypeError: Onirii is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"onirii","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}