-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
doc: improve buf.write() text in buffer.md #20115
Conversation
* Use present tense consistently in parameters description. * Wrap at 80 characters. * "partial amount of `string`" -> "part of `string`" * Unnecessary `Buffer.allocUnsafe()` changed to `Buffer.alloc()`.
|
||
```js | ||
const buf = Buffer.allocUnsafe(256); | ||
const buf = Buffer.alloc(256); |
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.
Nit: why not using the exact expected size?
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.
If we do this, we can simplify the line below into just console.log(`${len} bytes: ${buf}`);
, but this can become less educative)
Landed in 76f5b39 |
* Use present tense consistently in parameters description. * Wrap at 80 characters. * "partial amount of `string`" -> "part of `string`" * Unnecessary `Buffer.allocUnsafe()` changed to `Buffer.alloc()`. PR-URL: nodejs#20115 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
* Use present tense consistently in parameters description. * Wrap at 80 characters. * "partial amount of `string`" -> "part of `string`" * Unnecessary `Buffer.allocUnsafe()` changed to `Buffer.alloc()`. PR-URL: #20115 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
string
" -> "part ofstring
"Buffer.allocUnsafe()
changed toBuffer.alloc()
.Checklist