diff --git a/bin/pub.js b/bin/pub.js index fb7d0d63f..94b066b40 100755 --- a/bin/pub.js +++ b/bin/pub.js @@ -7,7 +7,7 @@ var pump = require('pump') var path = require('path') var fs = require('fs') var concat = require('concat-stream') -var Writable = require('stream').Writable +var Writable = require('readable-stream').Writable var helpMe = require('help-me')({ dir: path.join(__dirname, '..', 'doc') }) diff --git a/lib/client.js b/lib/client.js index bd06948e0..08fc443a1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -6,7 +6,7 @@ var EventEmitter = require('events').EventEmitter var Store = require('./store') var mqttPacket = require('mqtt-packet') -var Writable = require('stream').Writable +var Writable = require('readable-stream').Writable var inherits = require('inherits') var reInterval = require('reinterval') var validations = require('./validations') diff --git a/lib/connect/ali.js b/lib/connect/ali.js index 691b6d874..e7fe6a3c5 100644 --- a/lib/connect/ali.js +++ b/lib/connect/ali.js @@ -1,6 +1,6 @@ 'use strict' -var Transform = require('stream').Transform +var Transform = require('readable-stream').Transform var duplexify = require('duplexify') /* global FileReader */ diff --git a/lib/connect/ws.js b/lib/connect/ws.js index ffb91859a..5cb2bdd5e 100644 --- a/lib/connect/ws.js +++ b/lib/connect/ws.js @@ -4,7 +4,7 @@ const WS = require('ws') const debug = require('debug')('mqttjs:ws') const duplexify = require('duplexify') const urlModule = require('url') -const Transform = require('stream').Transform +const Transform = require('readable-stream').Transform let WSS_OPTIONS = [ 'rejectUnauthorized', diff --git a/lib/connect/wx.js b/lib/connect/wx.js index 250f15aac..b9c7a0705 100644 --- a/lib/connect/wx.js +++ b/lib/connect/wx.js @@ -1,6 +1,6 @@ 'use strict' -var Transform = require('stream').Transform +var Transform = require('readable-stream').Transform var duplexify = require('duplexify') /* global wx */ diff --git a/lib/store.js b/lib/store.js index ac870dae9..efbfabf09 100644 --- a/lib/store.js +++ b/lib/store.js @@ -5,7 +5,7 @@ */ var xtend = require('xtend') -var Readable = require('stream').Readable +var Readable = require('readable-stream').Readable var streamsOpts = { objectMode: true } var defaultStoreOptions = { clean: true diff --git a/package.json b/package.json index 874ad4c30..a6ec81230 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "minimist": "^1.2.5", "mqtt-packet": "^6.3.2", "pump": "^3.0.0", + "readable-stream": "^3.6.0", "reinterval": "^1.1.0", "split2": "^3.1.0", "ws": "^7.3.1", diff --git a/test/client.js b/test/client.js index b311cda7f..179ce7b1a 100644 --- a/test/client.js +++ b/test/client.js @@ -8,7 +8,7 @@ var abstractClientTests = require('./abstract_client') var net = require('net') var eos = require('end-of-stream') var mqttPacket = require('mqtt-packet') -var Duplex = require('stream').Duplex +var Duplex = require('readable-stream').Duplex var Connection = require('mqtt-connection') var MqttServer = require('./server').MqttServer var util = require('util') diff --git a/test/util.js b/test/util.js index 273846574..0dd559cb9 100644 --- a/test/util.js +++ b/test/util.js @@ -1,6 +1,6 @@ 'use strict' -var Transform = require('stream').Transform +var Transform = require('readable-stream').Transform module.exports.testStream = function () { return new Transform({