Skip to content

Commit

Permalink
doc: update buffer doc to include perf recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
debadree25 committed Jan 24, 2023
1 parent e487638 commit 1a5facf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3767,6 +3767,9 @@ console.log(buf2.toString('utf8', 0, 3));
console.log(buf2.toString(undefined, 0, 3));
// Prints: té
```
For encoding and decoding large strings to/from `utf-8`, it is recommended to use the
[`util.TextEncoder`][https://nodejs.org/api/util.html#class-utiltextencoder] and
[`util.TextDecoder`][https://nodejs.org/api/util.html#class-utiltextdecoder] APIs.

### `buf.values()`

Expand Down

0 comments on commit 1a5facf

Please sign in to comment.