stream-demux 8.0.0 → 8.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +8 -0
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -43,7 +43,7 @@ let demux = new StreamDemux();
43
43
  // the same time.
44
44
  // Note that you can optionally pass a number n to the
45
45
  // createConsumer(n) method to force the iteration to
46
- // timeout after n milliseconds of innactivity.
46
+ // timeout after n milliseconds of inactivity.
47
47
  let consumer = demux.stream('def').createConsumer();
48
48
  while (true) {
49
49
  let packet = await consumer.next();
package/index.js CHANGED
@@ -112,6 +112,14 @@ class StreamDemux {
112
112
  return this._mainStream.hasConsumer(consumerId);
113
113
  }
114
114
 
115
+ getConsumerCount(streamName) {
116
+ return this.getConsumerStatsList(streamName).length;
117
+ }
118
+
119
+ getConsumerCountAll() {
120
+ return this.getConsumerStatsListAll().length;
121
+ }
122
+
115
123
  createConsumer(streamName, timeout) {
116
124
  let mainStreamConsumer = this._mainStream.createConsumer(timeout);
117
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-demux",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "A consumable stream demultiplexer.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,6 +29,6 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "consumable-stream": "^2.0.0",
32
- "writable-consumable-stream": "^2.0.0"
32
+ "writable-consumable-stream": "^3.0.1"
33
33
  }
34
34
  }