Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Apr 17, 2018

  • 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().
Checklist

* 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()`.
@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Apr 17, 2018
@Trott
Copy link
Member Author

Trott commented Apr 17, 2018

@vsemozhetbyt vsemozhetbyt added the fast-track PRs that do not need to wait for 48 hours to land. label Apr 17, 2018
@vsemozhetbyt vsemozhetbyt added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 17, 2018

```js
const buf = Buffer.allocUnsafe(256);
const buf = Buffer.alloc(256);
Copy link
Member

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?

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Apr 19, 2018

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)

@Trott
Copy link
Member Author

Trott commented Apr 20, 2018

Landed in 76f5b39

@Trott Trott closed this Apr 20, 2018
Trott added a commit to Trott/io.js that referenced this pull request Apr 20, 2018
* 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]>
jasnell pushed a commit that referenced this pull request Apr 20, 2018
* 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]>
@Trott Trott deleted the buf-write branch January 13, 2022 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. fast-track PRs that do not need to wait for 48 hours to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants