{"name":"amqplib","homepage":"http://amqp-node.github.io/amqplib/","main":"./channel_api.js","version":"0.10.2","description":"An AMQP 0-9-1 (e.g., RabbitMQ) library and client.","repository":{"type":"git","url":"git+https://github.com/amqp-node/amqplib.git"},"engines":{"node":">=10"},"dependencies":{"bitsyntax":"~0.1.0","buffer-more-ints":"~1.0.0","readable-stream":"1.x >=1.1.9","url-parse":"~1.5.10"},"devDependencies":{"claire":"0.4.1","mocha":"^9.2.2","nyc":"^15.1.0","uglify-js":"2.8.x"},"scripts":{"test":"make test","prepare":"make"},"keywords":["AMQP","AMQP 0-9-1","RabbitMQ"],"author":{"name":"Michael Bridgen","email":"mikeb@squaremobius.net"},"license":"MIT","gitHead":"62433e5009aa59979b7cf06058673eb2b9f45689","bugs":{"url":"https://github.com/amqp-node/amqplib/issues"},"_id":"amqplib@0.10.2","_nodeVersion":"18.3.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-l8U1thHT5QRNJF6Fv6ZveMeHV/bl+3UROQBn/cLOwRfeV3F0syZxkjnumJCG4NMvqfy9wT7mCgwpPSq2fApRpA==","shasum":"04ec8cbdcdf526dc36a4e46fb0591d449dca3372","tarball":"http://registry-npm.ywwl.com/amqplib/download/amqplib-0.10.2.tgz","fileCount":67,"unpackedSize":401989,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJWhIx+QdOGqYQivtt7Oza61yhbFrN+xp8QxmyWVaTXAiBCcnX7huL1XXaTeIMMMSgaplHd3cquN6ccKCCCFm4leA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi733UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAEg//XNcyqYBCoPYz9O4qlCwgseyqOGfXVF3N+LUKEtqusG9qUZbk\r\nbSY6Lp77bOfvsW/4zcqmrdFIID/RaQSC/3LRokoh4yeW8CnPZiab1BXhxMJs\r\nxyN0ChkKAXyhZmCDZJCRVcktEGABKxdig4hbogcFjOCp6871/PZLl2hz4PkG\r\n0AWiE54ysVlq9YreMXw/gHx499EfDPMTuC7cxoik18PsTDuEF80vHgCVyYHU\r\n6tpe7E14PQDhQG/AcnzP717NBi8lOcoOZrM7J0Y2WBfmFHCoAWag6JhK5bTG\r\nqFnY8Rupvt41bXJVquOnopy94Trsew5/AcAdVNNC2i/ylq2ZIYlsG1rHg50v\r\nf8+vOu7TxgA5YCbM1RMEOML/7JnsuVnRdPgyxhedNLOAfO16H6u3/qlUG5x+\r\nXO9DFL673XBmRQqU86isgcTI4tVL0MFJNgoxqrcwPNG8t4zshKh5TfUCqAog\r\nhGP6tMsx/N2bN2aug71VAuH8VNyfKr1gbF/KNULRVpkiGzYj7gSNUuFM37uf\r\nuJ6zXJHB+m7na5urwKD7oeXTg+tlWfcKfK3DG7oX2rA9svxpnmolfEHZgPgB\r\nuJ3NnmDCjJm0U0TMP8a2pJ3oBVHqQLlOcvzhikPW5c5/zFsrkNeeEpTcM8b2\r\nA6FcETp9eCBO7U7dTxX8hSJ9OxrsuXfP9HI=\r\n=+WA3\r\n-----END PGP SIGNATURE-----\r\n","size":79838,"noattachment":false,"key":"/amqplib/-/amqplib-0.10.2.tgz"},"_npmUser":{"name":"cressie176","email":"stephen.cresswell@gmail.com"},"directories":{},"maintainers":[{"name":"squaremo","email":"mikeb@squaremobius.net"},{"name":"cressie176","email":"stephen.cresswell@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/amqplib_0.10.2_1659862484001_0.06678699307004154"},"_hasShrinkwrap":false,"readme":"# AMQP 0-9-1 library and client for Node.JS\n\n[![NPM version](https://img.shields.io/npm/v/amqplib.svg?style=flat-square)](https://www.npmjs.com/package/amqplib)\n[![NPM downloads](https://img.shields.io/npm/dm/amqplib.svg?style=flat-square)](https://www.npmjs.com/package/amqplib)\n[![Node.js CI](https://github.com/amqp-node/amqplib/workflows/Node.js%20CI/badge.svg)](https://github.com/amqp-node/amqplib/actions?query=workflow%3A%22Node.js+CI%22)\n[![amqplib](https://snyk.io/advisor/npm-package/amqplib/badge.svg)](https://snyk.io/advisor/npm-package/amqplib)\n\n    npm install amqplib\n\n * [Change log][changelog]\n * [GitHub pages][gh-pages]\n * [API reference][gh-pages-apiref]\n * [Troubleshooting][gh-pages-trouble]\n * [Examples from RabbitMQ tutorials][tutes]\n\n\nA library for making AMQP 0-9-1 clients for Node.JS, and an AMQP 0-9-1 client for Node.JS v10+.\n\nThis library does not implement [AMQP\n1.0](https://github.com/squaremo/amqp.node/issues/63) or [AMQP\n0-10](https://github.com/squaremo/amqp.node/issues/94).\n\nProject status:\n\n - Expected to work\n - Complete high-level and low-level APIs (i.e., all bits of the protocol)\n - Stable APIs\n - A fair few tests\n - Measured test coverage\n - Ports of the [RabbitMQ tutorials][rabbitmq-tutes] as [examples][tutes]\n - Used in production\n\nStill working on:\n\n - Getting to 100% (or very close to 100%) test coverage\n\n## Callback API example\n\n```javascript\nconst amqplib = require('amqplib/callback_api');\nconst queue = 'tasks';\n\namqplib.connect('amqp://localhost', (err, conn) => {\n  if (err) throw err;\n\n  // Listener\n  conn.createChannel((err, ch2) => {\n    if (err) throw err;\n\n    ch2.assertQueue(queue);\n\n    ch2.consume(queue, (msg) => {\n      if (msg !== null) {\n        console.log(msg.content.toString());\n        ch2.ack(msg);\n      } else {\n        console.log('Consumer cancelled by server');\n      }\n    });\n  });\n\n  // Sender\n  conn.createChannel((err, ch1) => {\n    if (err) throw err;\n\n    ch1.assertQueue(queue);\n\n    setInterval(() => {\n      ch1.sendToQueue(queue, Buffer.from('something to do'));\n    }, 1000);\n  });\n});\n```\n\n## Promise/Async API example\n\n```javascript\nconst amqplib = require('amqplib');\n\n(async () => {\n  const queue = 'tasks';\n  const conn = await amqplib.connect('amqp://localhost');\n\n  const ch1 = await conn.createChannel();\n  await ch1.assertQueue(queue);\n\n  // Listener\n  ch1.consume(queue, (msg) => {\n    if (msg !== null) {\n      console.log('Received:', msg.content.toString());\n      ch1.ack(msg);\n    } else {\n      console.log('Consumer cancelled by server');\n    }\n  });\n\n  // Sender\n  const ch2 = await conn.createChannel();\n\n  setInterval(() => {\n    ch2.sendToQueue(queue, Buffer.from('something to do'));\n  }, 1000);\n})();\n\n```\n\n## Running tests\n\n    npm test\n\nTo run the tests RabbitMQ is required. Either install it with your package\nmanager, or use [docker][] to run a RabbitMQ instance.\n\n    docker run -d --name amqp.test -p 5672:5672 rabbitmq\n\nIf prefer not to run RabbitMQ locally it is also possible to use a\ninstance of RabbitMQ hosted elsewhere. Use the `URL` environment\nvariable to configure a different amqp host to connect to. You may\nalso need to do this if docker is not on localhost; e.g., if it's\nrunning in docker-machine.\n\nOne public host is dev.rabbitmq.com:\n\n    URL=amqp://dev.rabbitmq.com npm test\n\n**NB** You may experience test failures due to timeouts if using the\ndev.rabbitmq.com instance.\n\nYou can run it under different versions of Node.JS using [nave][]:\n\n    nave use 10 npm test\n\nor run the tests on all supported versions of Node.JS in one go:\n\n    make test-all-nodejs\n\n(which also needs `nave` installed, of course).\n\nLastly, setting the environment variable `LOG_ERRORS` will cause the\ntests to output error messages encountered, to the console; this is\nreally only useful for checking the kind and formatting of the errors.\n\n    LOG_ERRORS=true npm test\n\n## Test coverage\n\n    make coverage\n    open file://`pwd`/coverage/lcov-report/index.html\n\n[gh-pages]: https://amqp-node.github.io/amqplib/\n[gh-pages-apiref]: https://amqp-node.github.io/amqplib/channel_api.html\n[gh-pages-trouble]: https://amqp-node.github.io/amqplib/#troubleshooting\n[nave]: https://github.com/isaacs/nave\n[tutes]: https://github.com/amqp-node/amqplib/tree/main/examples/tutorials\n[rabbitmq-tutes]: http://www.rabbitmq.com/getstarted.html\n[changelog]: https://github.com/amqp-node/amqplib/blob/main/CHANGELOG.md\n[docker]: https://www.docker.com/\n","publish_time":1659862484209,"_cnpm_publish_time":1659862484209,"dist-tags":{"latest":"2.2.1"}}