diff --git a/package.json b/package.json index 1bd53db..09734b1 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "duplexer": "^0.1.2", "minimist": "^1.2.6", "npm-which": "^1.0.2", + "readable-stream": "^2.3.7", "safe-regex-test": "^1.0.0", "sprintf-js": "^1.1.2", "string.prototype.split": "^1.0.6", diff --git a/test/long-message/index.js b/test/long-message/index.js index 25823eb..6ad0984 100644 --- a/test/long-message/index.js +++ b/test/long-message/index.js @@ -1,7 +1,7 @@ 'use strict'; var test = require('tape'); -var stream = require('stream'); +var Readable = require('readable-stream'); var path = require('path'); var fs = require('fs'); var faucet = require('../..'); @@ -11,11 +11,14 @@ function createFormatter() { } function streamifyString(string) { - return new stream.Readable({ - read: function () { - this.push(string); - this.push(null); - } + function read() { + /* eslint no-invalid-this: 0 */ + this.push(string); + this.push(null); + } + return new Readable({ + _read: read, + read: read }); }