{"name":"amqplib","homepage":"http://squaremo.github.io/amqp.node/","main":"./channel_api.js","version":"0.7.0","description":"An AMQP 0-9-1 (e.g., RabbitMQ) library and client.","repository":{"type":"git","url":"git+https://github.com/squaremo/amqp.node.git"},"engines":{"node":">=0.8 <=15"},"dependencies":{"bitsyntax":"~0.1.0","bluebird":"^3.5.2","buffer-more-ints":"~1.0.0","readable-stream":"1.x >=1.1.9","safe-buffer":"~5.1.2","url-parse":"~1.4.3"},"devDependencies":{"claire":"0.4.1","istanbul":"0.1.x","mocha":"^3.5.3","uglify-js":"2.6.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":"99a854f9fccac0517ed58696058f9ccd8e356b2e","bugs":{"url":"https://github.com/squaremo/amqp.node/issues"},"_id":"amqplib@0.7.0","_shasum":"83ae81d5bce3406bc8c75a90b9c4789cbbd1e6c4","_from":".","_npmVersion":"2.15.12","_nodeVersion":"11.1.0","_npmUser":{"name":"squaremo","email":"mikeb@squaremobius.net"},"dist":{"shasum":"83ae81d5bce3406bc8c75a90b9c4789cbbd1e6c4","tarball":"http://registry-npm.ywwl.com/amqplib/download/amqplib-0.7.0.tgz","integrity":"sha512-WIH+AV/p2UU7YUaP35m0uDlG871YFLm4pz5MKVVNz11OSWUYfWvbsPMklbSDTAbXscvbUB+QO4Z8HsgkfaqNeQ==","fileCount":68,"unpackedSize":449454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM8AuCRA9TVsSAnZWagAAiCYQAIEx6IfyZhu0TGky90l7\nfsTDMKdGmVCPHO1VGmJVB2E8IFwmFvMEJsfH1hEDlxKQ/oy1UT3u5SgyFt+D\nXfY2oeAw9eB2zvC/92y4rpuzKu67ePYzb6i1bCco6Fim8OSSWZwBStbTzrTM\npr+SvPNezjPvi+FdRLd8y+TQ8vu9GdfDtjfcADMQ3SF8gDK+Tq/kvTxrjxCj\nYMgb2q1BeHLReDn/1rOWZ9FvYwwF+OvdItR0vF+N6H+N9mxg97KbA7FDGlFM\n8MHoNdk6Xrxtmjoeja7Y8yX9UAkMKAZTzGZnoNEW/ZIdFM2j+U0ZQ+EPZTI+\n8Ogh5M981xYTLgNa/EnYBPAOa/8IQ3oQgb09J2Ac0aoL/EnuwR8Zv2t3x0rk\nidmlMgtwY0llxPxyw/uyUHiRiAvOn8htvXNUM25wkRcpyf9gem4GlsqWXWSf\nNHvLUk8uFLk7hNsuegRMrjdBD5n7NsY2VsfmyP59LUAZT5M22xhH6eC9xtOV\nDigePC1O8xEHuHZ4JtGpjazevM6BveN6qrtoUcpZiooYETIjjtGitfPmPwO0\nAnTWknW9Kb4JRm+SoFIJzDWhK6mnmez7vwGPZEuMzyAX2mEzKhE4sd/jrsi6\n08+PWrbv0hNGQG/1wHFnPiIPRLd6FfW3ftwfd9GKMijDlsVzO0qCrsTAh17e\nQ0/u\r\n=eFfu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2aYMhfnt9BWrDeEJ25hBml6inhDzJePKXVMTL2dJjSQIgNJHShtKYqwVY6WjxmLO/IRqzbBTri7k8WsgcZUWQ7o0="}],"size":86134,"noattachment":false,"key":"/amqplib/-/amqplib-0.7.0.tgz"},"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.7.0_1614004270013_0.097458798472281"},"_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":1614004270139,"_cnpm_publish_time":1614004270139,"dist-tags":{"latest":"2.2.1"}}