new buffer.Blob([sources[, options]])
sources
<string[]> | <ArrayBuffer[]> | <TypedArray[]> | <DataView[]> | <Blob[]> 将存储在Blob
中的字符串数组、<ArrayBuffer>、<TypedArray>、<DataView> 或 <Blob> 对象、或此类对象的任何组合。options
<Object>
创建新的 Blob
对象,其中包含给定源的串接。
<ArrayBuffer>、<TypedArray>、<DataView> 和 <Buffer> 源被复制到 'Blob' 中,因此可以在创建 'Blob' 后安全地修改。
字符串源被编码为 UTF-8 字节序列并复制到 Blob 中。 每个字符串部分中不匹配的代理对将被 Unicode U+FFFD 替换字符替换。
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 theBlob
.options
<Object>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 byrequire('node:os').EOL
.type
<string> The Blob content-type. The intent is fortype
to convey the MIME media type of the data, however no validation of the type format is performed.
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 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.