Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/buffer.md')
-rw-r--r--doc/api/buffer.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md
index f419be1181a..0e4fefdf8ed 100644
--- a/doc/api/buffer.md
+++ b/doc/api/buffer.md
@@ -459,14 +459,20 @@ multiple worker threads.
### `new buffer.Blob([sources[, options]])`
<!-- YAML
added: v15.7.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/39708
+ description: Added the standard `endings` option to replace line-endings,
+ and removed the non-standard `encoding` option.
-->
* `sources` {string[]|ArrayBuffer[]|TypedArray[]|DataView[]|Blob[]} An array
of string, {ArrayBuffer}, {TypedArray}, {DataView}, or {Blob} objects, or
any mix of such objects, that will be stored within the `Blob`.
* `options` {Object}
- * `encoding` {string} The character encoding to use for string sources.
- **Default:** `'utf8'`.
+ * `endings` {string} One of either `'transparent'` or `'native'`. When set
+ to `'native'`, line endings in string source parts will be converted to
+ the platform native line-ending as specified by `require('os').EOL`.
* `type` {string} The Blob content-type. The intent is for `type` to convey
the MIME media type of the data, however no validation of the type format
is performed.
@@ -476,7 +482,9 @@ Creates a new `Blob` object containing a concatenation of the given sources.
{ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
the 'Blob' and can therefore be safely modified after the 'Blob' is created.
-String sources are also copied into the `Blob`.
+String sources are encoded as UTF-8 byte sequences and copied into the Blob.
+Unmatched surrogate pairs within each string part will be replaced by Unicode
+U+FFFD replacement characters.
### `blob.arrayBuffer()`
<!-- YAML