We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cafb2a5 commit ea11365Copy full SHA for ea11365
lib/stream.js
@@ -1,13 +1,14 @@
1
-// Attempt to use readable-stream if available, attempt to use the built-in stream module.
+// Attempt to use the native ReadbleStream if available, otherwise check for the `readable-stream` package or the built-in Node.js `stream` module.
2
let Readable;
3
-try {
4
- Readable = require("readable-stream").Readable;
5
-} catch (e) {
+
+if (typeof ReadableStream === 'undefined') {
6
try {
7
- Readable = require("stream").Readable;
+ Readable = require("readable-stream").Readable || require("stream").Readable;
8
} catch (e) {
9
Readable = null;
10
}
+} else {
11
+ Readable = ReadableStream;
12
13
14
/**
0 commit comments