Skip to content

Commit ea11365

Browse files
committed
fix
1 parent cafb2a5 commit ea11365

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/stream.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
// Attempt to use readable-stream if available, attempt to use the built-in stream module.
1+
// Attempt to use the native ReadbleStream if available, otherwise check for the `readable-stream` package or the built-in Node.js `stream` module.
22
let Readable;
3-
try {
4-
Readable = require("readable-stream").Readable;
5-
} catch (e) {
3+
4+
if (typeof ReadableStream === 'undefined') {
65
try {
7-
Readable = require("stream").Readable;
6+
Readable = require("readable-stream").Readable || require("stream").Readable;
87
} catch (e) {
98
Readable = null;
109
}
10+
} else {
11+
Readable = ReadableStream;
1112
}
1213

1314
/**

0 commit comments

Comments
 (0)