File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -2074,19 +2074,21 @@ for (const value of buf) {
2074
2074
added: v0.1.90
2075
2075
-->
2076
2076
2077
- * ` string ` {string} String to be written to ` buf ` .
2078
- * ` offset ` {integer} Number of bytes to skip before starting to write ` string ` . ** Default:** ` 0 ` .
2079
- * ` length ` {integer} Number of bytes to write. ** Default:** ` buf.length - offset ` .
2077
+ * ` string ` {string} String to write to ` buf ` .
2078
+ * ` offset ` {integer} Number of bytes to skip before starting to write ` string ` .
2079
+ ** Default:** ` 0 ` .
2080
+ * ` length ` {integer} Number of bytes to write. ** Default:**
2081
+ ` buf.length - offset ` .
2080
2082
* ` encoding ` {string} The character encoding of ` string ` . ** Default:** ` 'utf8' ` .
2081
2083
* Returns: {integer} Number of bytes written.
2082
2084
2083
- Writes ` string ` to ` buf ` at ` offset ` according to the character encoding in ` encoding ` .
2084
- The ` length ` parameter is the number of bytes to write. If ` buf ` did not contain
2085
- enough space to fit the entire string, only a partial amount of ` string ` will
2086
- be written. However, partially encoded characters will not be written.
2085
+ Writes ` string ` to ` buf ` at ` offset ` according to the character encoding in
2086
+ ` encoding ` . The ` length ` parameter is the number of bytes to write. If ` buf ` did
2087
+ not contain enough space to fit the entire string, only part of ` string ` will be
2088
+ written. However, partially encoded characters will not be written.
2087
2089
2088
2090
``` js
2089
- const buf = Buffer .allocUnsafe (256 );
2091
+ const buf = Buffer .alloc (256 );
2090
2092
2091
2093
const len = buf .write (' \u00bd + \u00bc = \u00be ' , 0 );
2092
2094
You can’t perform that action at this time.
0 commit comments