rascal 20.1.0 → 21.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## 21.0.0
4
+ - **BREAKING**: Drop Node.js 14 support (EOL since April 2023). Minimum Node.js version is now 16.
5
+
6
+ ## 20.1.2
7
+ - Remove codeclimate (it's been sold) until we have time to replace get it working again.
8
+
9
+ ## 20.1.1
10
+ - npm search algorithm has changed. Updating metadata accordingly.
11
+
3
12
  ## 20.1.0
4
13
  - Ignore and remove immediateNack header based on the xDeath header. See https://github.com/onebeyond/rascal/issues/237
5
14
 
package/README.md CHANGED
@@ -1,18 +1,14 @@
1
- # Rascal
1
+ # Rascal - A RabbitMQ / AMQP Client
2
2
 
3
- Rascal is a rich pub/sub wrapper around [amqplib](https://www.npmjs.com/package/amqplib).
3
+ Rascal is an advanced RabbitMQ / AMQP client built on [amqplib](https://www.npmjs.com/package/amqplib).
4
4
 
5
5
  [![NPM version](https://img.shields.io/npm/v/rascal.svg?style=flat-square)](https://www.npmjs.com/package/rascal)
6
6
  [![NPM downloads](https://img.shields.io/npm/dm/rascal.svg?style=flat-square)](https://www.npmjs.com/package/rascal)
7
7
  [![Node.js CI](https://github.com/onebeyond/rascal/workflows/Node.js%20CI/badge.svg)](https://github.com/onebeyond/rascal/actions?query=workflow%3A%22Node.js+CI%22)
8
- [![Code Climate](https://codeclimate.com/github/onebeyond/rascal/badges/gpa.svg)](https://codeclimate.com/github/onebeyond/rascal)
9
- [![Test Coverage](https://codeclimate.com/github/onebeyond/rascal/badges/coverage.svg)](https://codeclimate.com/github/onebeyond/rascal/coverage)
10
- [![rascal](https://snyk.io/advisor/npm-package/rascal/badge.svg)](https://snyk.io/advisor/npm-package/rascal)
11
- [![Discover zUnit](https://img.shields.io/badge/Discover-zUnit-brightgreen)](https://www.npmjs.com/package/zunit)
12
8
 
13
9
  ## About
14
10
 
15
- Rascal is a rich pub/sub wrapper for the excellent [amqplib](https://www.npmjs.com/package/amqplib). One of the best things about amqplib is that it doesn't make assumptions about how you use it. Another is that it doesn't attempt to abstract away [AMQP Concepts](https://www.rabbitmq.com/tutorials/amqp-concepts.html). As a result the library offers a great deal of control and flexibility, but the onus is on you adopt appropriate patterns and configuration. You need to be aware that:
11
+ Rascal is an advanced RabbitMQ / AMQP client built on [amqplib](https://www.npmjs.com/package/amqplib). One of the best things about amqplib is that it doesn't make assumptions about how you use it. Another is that it doesn't attempt to abstract away [AMQP Concepts](https://www.rabbitmq.com/tutorials/amqp-concepts.html). As a result the library offers a great deal of control and flexibility, but the onus is on you adopt appropriate patterns and configuration. You need to be aware that:
16
12
 
17
13
  - Messages are not persistent by default and will be lost if your broker restarts
18
14
  - Messages that crash your app will be infinitely retried
@@ -601,7 +597,7 @@ Running automated tests against shared queues and exchanges is problematic. Mess
601
597
  }
602
598
  ```
603
599
 
604
- If you specify `"namespace" :true` Rascal will prefix the queues and exchanges it creates with a uuid. Alternatively you can specify your own namespace, `"namespace": "foo"`. Namespaces are also if you want to use a single vhost locally but multiple vhosts in other environments.
600
+ If you specify `"namespace" :true` Rascal will prefix the queues and exchanges it creates with a uuid. Alternatively you can specify your own namespace, `"namespace": "foo"`. Namespaces may also be helpful if you want to use a single vhost locally but multiple vhosts in other environments.
605
601
 
606
602
  #### Exchanges
607
603
 
@@ -4,17 +4,16 @@ var config = require('./config');
4
4
  Rascal.Broker.create(Rascal.withDefaultConfig(config), function (err, broker) {
5
5
  if (err) throw err;
6
6
 
7
- broker
8
- .subscribe('demo_sub', function (err, subscription) {
9
- if (err) throw err;
10
- subscription
11
- .on('message', function (message, content, ackOrNack) {
12
- console.log(content);
13
- ackOrNack();
14
- })
15
- .on('error', console.error);
16
- })
17
- .on('error', console.error);
7
+ broker.subscribe('demo_sub', function (err, subscription) {
8
+ if (err) throw err;
9
+ subscription
10
+ .on('message', function (message, content, ackOrNack) {
11
+ console.log(content);
12
+ ackOrNack();
13
+ })
14
+ .on('error', console.error);
15
+ });
16
+ broker.on('error', console.error);
18
17
 
19
18
  setInterval(function () {
20
19
  broker.publish('demo_pub', new Date().toISOString() + ': hello world', 'demo_q', function (err, publication) {
@@ -1,18 +1,11 @@
1
- const get = require('lodash').get;
2
-
3
- module.exports = function (options) {
4
- const min = get(options, 'min', 1000);
5
- const max = get(options, 'max', min);
1
+ module.exports = function (options = {}) {
2
+ const min = options.min || 1000;
3
+ const max = options.max || min;
4
+ const range = max - min;
6
5
 
7
6
  function next() {
8
- return Math.floor(Math.random() * (max - min + 1) + min);
7
+ return range === 0 ? min : Math.floor(Math.random() * (range + 1) + min);
9
8
  }
10
9
 
11
- // eslint-disable-next-line no-empty-function
12
- function reset() {}
13
-
14
- return {
15
- next,
16
- reset,
17
- };
10
+ return { next, reset: () => {} };
18
11
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rascal",
3
- "version": "20.1.0",
4
- "description": "A config driven wrapper for amqplib supporting multi-host connections, automatic error recovery, redelivery flood protection, transparent encryption / decryption, channel pooling and publication timeouts",
3
+ "version": "21.0.0",
4
+ "description": "An advanced RabbitMQ / AMQP client built on amqplib",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "async": "^3.2.4",
@@ -47,13 +47,10 @@
47
47
  "**/*.js": "eslint --fix"
48
48
  },
49
49
  "keywords": [
50
- "amqplib",
51
- "amqp",
52
50
  "rabbitmq",
53
- "callback",
54
- "promise",
55
- "await",
56
- "async"
51
+ "rabbit",
52
+ "amqplib",
53
+ "amqp"
57
54
  ],
58
55
  "repository": {
59
56
  "type": "git",