-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
maybe require('buffer') could show a message #6891
Comments
Node has no (reliable) way to determine how the return value of
That would be a breaking change and rather disruptive to the ecosystem, so the chances of that happening are low. What might be an option is to change Buffer.Buffer = Buffer;
Buffer.SlowBuffer = SlowBuffer;
// etc.
module.exports = Buffer; But personally, I don't think that's much of an improvement. |
@mh-cbon Why should it throw? |
:s I see, makes sense, thanks for information. So i was thinking, maybe that sentence, at the beginning of the doc page about
As As a doc reader I d say it should stop right after the coma. |
@mh-cbon Perhaps that should look like this instead:
But I'm not sure. /cc @nodejs/documentation |
Fixes: nodejs#6891 PR-URL: nodejs#6914 Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
I misread the doc, i did
var Buffer = require('buffer');
and could not figure out why this was trueBuffer.alloc===undefined
.Maybe node could display a warning message if someone tries to require buffer like i did, or, maybe it could throw an error as if it was not an existing package ?
The text was updated successfully, but these errors were encountered: