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) {
20742074added: v0.1.90
20752075-->
20762076
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 ` .
20802082* ` encoding ` {string} The character encoding of ` string ` . ** Default:** ` 'utf8' ` .
20812083* Returns: {integer} Number of bytes written.
20822084
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.
20872089
20882090``` js
2089- const buf = Buffer .allocUnsafe (256 );
2091+ const buf = Buffer .alloc (256 );
20902092
20912093const len = buf .write (' \u00bd + \u00bc = \u00be ' , 0 );
20922094
You can’t perform that action at this time.
0 commit comments