diff options
author | James M Snell <jasnell@gmail.com> | 2021-08-07 02:54:13 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2021-08-12 17:23:10 +0300 |
commit | 0bb2605f85f1b7e52607ec42909b910f4bab3f09 (patch) | |
tree | 7400af051a56db3383ce36a4a590215245eb2736 /doc/api | |
parent | 87d6fd7e696ee02178a8dc33a51e8e59bdc61d68 (diff) |
buffer: add Blob.prototype.stream method and other cleanups
Adds the `stream()` method to get a `ReadableStream` for the `Blob`.
Also makes some other improvements to get the implementation closer
to the API standard definition.
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/39693
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/buffer.md | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md index f35c2f9ce6f..7106d5c6b36 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -507,6 +507,15 @@ added: v15.7.0 Creates and returns a new `Blob` containing a subset of this `Blob` objects data. The original `Blob` is not altered. +### `blob.stream()` +<!-- YAML +added: REPLACEME +--> + +* Returns: {ReadableStream} + +Returns a new `ReadableStream` that allows the content of the `Blob` to be read. + ### `blob.text()` <!-- YAML added: v15.7.0 @@ -514,8 +523,8 @@ added: v15.7.0 * Returns: {Promise} -Returns a promise that resolves the contents of the `Blob` decoded as a UTF-8 -string. +Returns a promise that fulfills with the contents of the `Blob` decoded as a +UTF-8 string. ### `blob.type` <!-- YAML |