qrusty-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/index.html +65 -0
- package/docs/index.js.html +136 -0
- package/docs/module-QrustyClient-QrustyClient.html +1317 -0
- package/docs/module-QrustyClient.html +172 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/styles/jsdoc-default.css +358 -0
- package/docs/styles/prettify-jsdoc.css +111 -0
- package/docs/styles/prettify-tomorrow.css +132 -0
- package/index.js +85 -0
- package/jsdoc.json +13 -0
- package/package.json +19 -0
- package/test.js +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# qrusty-client
|
|
2
|
+
|
|
3
|
+
Node.js client for the qrusty priority queue server API.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Connect to a qrusty server
|
|
8
|
+
- Publish, consume, ack, and purge messages
|
|
9
|
+
- List and manage queues
|
|
10
|
+
- Promise-based API using axios
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install qrusty-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
const QrustyClient = require('qrusty-client');
|
|
22
|
+
const client = new QrustyClient('http://localhost:3000');
|
|
23
|
+
|
|
24
|
+
(async () => {
|
|
25
|
+
await client.publish('orders', 100, { order_id: 123 });
|
|
26
|
+
const msg = await client.consume('orders', 'worker-1');
|
|
27
|
+
await client.ack('orders', msg.id, 'worker-1');
|
|
28
|
+
})();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Documentation
|
|
32
|
+
|
|
33
|
+
Generate HTML docs with:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run docs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Testing
|
|
40
|
+
|
|
41
|
+
Run unit tests with:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Publishing
|
|
48
|
+
|
|
49
|
+
1. Log in to npm (if you haven't):
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm login
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. Publish the package:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm publish
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Credentials Needed
|
|
62
|
+
|
|
63
|
+
- You need an npm account (<https://www.npmjs.com/>)
|
|
64
|
+
- Run `npm login` and enter your username, password, and email
|
|
65
|
+
- This stores your credentials in `~/.npmrc` for publishing
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|
|
Binary file
|