UNPKG

1.79 kBMarkdownView Raw
1# amqpuri
2
3[![Greenkeeper badge](https://badges.greenkeeper.io/nfantone/amqp-uri.svg)](https://greenkeeper.io/)
4[![Build Status](https://travis-ci.org/nfantone/amqp-uri.svg?branch=develop)](https://travis-ci.org/nfantone/amqp-uri) [![codecov.io](https://codecov.io/github/nfantone/amqp-uri/coverage.svg?branch=develop)](https://codecov.io/github/nfantone/amqp-uri?branch=develop) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/nfantone/amqp-uri/blob/master/LICENSE)
5
6Create [AMQP URIs][3] as you would with [node's url][1]
7
8## Install
9```sh
10npm i --save amqpuri
11```
12
13> This module does _not_ support `node < 6.0.0`. If you need to install this in older versions, consider using [amqp-uri][2]
14
15## Usage
16```js
17const amqpuri = require('amqpuri');
18
19const uri = amqpuri.format({
20 hostname: 'dev.rabbitmq.com',
21 port: 5672,
22 vhost: 'seneca',
23 username: 'guest',
24 password: 'guest',
25 frameMax: 1024,
26 channelMax: 1000,
27 heartbeat: 500,
28 locale: 'en_US'
29});
30
31console.log(uri);
32// amqp://guest:guest@dev.rabbitmq.com:5672/seneca?frameMax=1024&channelMax=1000&heartbeat=500&locale=en_US
33```
34
35## Test
36To run tests, clone the repository, install dependencies and call the appropriate `npm` script.
37
38```sh
39git clone https://github.com/nfantone/amqp-uri.git amqpuri
40cd amqpuri
41npm i
42npm test
43```
44
45## License
46MIT
47
48[1]: https://nodejs.org/api/url.html
49[2]: https://www.npmjs.com/package/amqp-uri
50[3]: https://www.rabbitmq.com/uri-spec.html