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: clarify length param in buffer.write #32119

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -1994,8 +1994,11 @@ added: v0.1.90
* `string` {string} String to write to `buf`.
* `offset` {integer} Number of bytes to skip before starting to write `string`.
**Default:** `0`.
* `length` {integer} Maximum number of bytes to write. **Default:**
`buf.length - offset`.
* `length` {integer} Maximum number of bytes to write (written bytes will not
exceed `buf.length - offset`). **Default:** `buf.length - offset`.
If the buffer has sufficient space from the offset, the string is written upto
addaleax marked this conversation as resolved.
Show resolved Hide resolved
`length`. If the buffer is short in space, only `buf.length - offset`
bytes are written.
addaleax marked this conversation as resolved.
Show resolved Hide resolved
* `encoding` {string} The character encoding of `string`. **Default:** `'utf8'`.
* Returns: {integer} Number of bytes written.

Expand Down