-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix require() of readable-stream to allow usage of node-core stream #56
Conversation
bl.js
Outdated
@@ -1,4 +1,4 @@ | |||
var DuplexStream = require('readable-stream/duplex') | |||
var DuplexStream = require('stream').Duplex || require('readable-stream').Duplex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately no. It should be require('readable-stream').Duplex
if you want to change this.
This is not really a fallback, but a dependency in the true sense.
Is there a reason for pinning to userland? Were there changes to the Streams API since the oldest nodejs LTS version till current? Readable-streams library reads whether process.env.READABLE_STREAM has been disabled. Is it safe to set this flag? |
I have revised the code to get Duplex from main readable.js . This allows the application code to give precedence to core-land stream rather than userland stream. |
There is no need for this. Duplex will always be present in readable-stream. |
Agreed. Enough to just have var DuplexStream = require('readable-stream').Duplex Instead of the current var DuplexStream = require('readable-stream/duplex') |
bl.js
Outdated
@@ -1,4 +1,4 @@ | |||
var DuplexStream = require('readable-stream/duplex') | |||
var DuplexStream = require('readable-stream').Duplex || require('stream').Duplex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove require('stream').Duplex
?
Yes. Will do so once I get to my laptop |
Updated with much thanks. |
No description provided.