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
path: root/doc/api
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2021-07-11 05:26:31 +0300
committerJames M Snell <jasnell@gmail.com>2021-07-14 19:12:43 +0300
commit25e2f177cb3598e2452bcafed16fbd96fe33da94 (patch)
tree496ea26ce2fcf44fe4c5dc296688ebfe46dca417 /doc/api
parentc6a20778688a361c14611e8d0622fe8956e4633d (diff)
stream: implement TextEncoderStream and TextDecoderStream
Experimental as part of the web streams implementation Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/39347 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/webstreams.md99
1 files changed, 99 insertions, 0 deletions
diff --git a/doc/api/webstreams.md b/doc/api/webstreams.md
index 407230f9681..0bacb7b475f 100644
--- a/doc/api/webstreams.md
+++ b/doc/api/webstreams.md
@@ -1118,5 +1118,104 @@ added: v16.5.0
* `chunk` {any}
* Returns: {number}
+### Class: `TextEncoderStream`
+<!-- YAML
+added: REPLACEME
+-->
+
+#### `new TextEncoderStream()`
+<!-- YAML
+added: REPLACEME
+-->
+
+Creates a new `TextEncoderStream` instance.
+
+#### `textEncoderStream.encoding`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {string}
+
+The encoding supported by the `TextEncoderStream` instance.
+
+#### `textEncoderStream.readable`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {ReadableStream}
+
+#### `textEncoderStream.writable`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {WritableStream}
+
+### Class: `TextDecoderStream`
+<!-- YAML
+added: REPLACEME
+-->
+
+#### `new TextDecoderStream([encoding[, options]])`
+<!-- YAML
+added: REPLACEME
+-->
+
+* `encoding` {string} Identifies the `encoding` that this `TextDecoder` instance
+ supports. **Default:** `'utf-8'`.
+* `options` {Object}
+ * `fatal` {boolean} `true` if decoding failures are fatal.
+ * `ignoreBOM` {boolean} When `true`, the `TextDecoderStream` will include the
+ byte order mark in the decoded result. When `false`, the byte order mark
+ will be removed from the output. This option is only used when `encoding` is
+ `'utf-8'`, `'utf-16be'` or `'utf-16le'`. **Default:** `false`.
+
+Creates a new `TextDecoderStream` instance.
+
+#### `textDecoderStream.encoding`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {string}
+
+The encoding supported by the `TextDecoderStream` instance.
+
+#### `textDecoderStream.fatal`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {boolean}
+
+The value will be `true` if decoding errors result in a `TypeError` being
+thrown.
+
+#### `textDecoderStream.ignoreBOM`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {boolean}
+
+The value will be `true` if the decoding result will include the byte order
+mark.
+
+#### `textDecoderStream.readable`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {ReadableStream}
+
+#### `textDecoderStream.writable`
+<!-- YAML
+added: REPLACEME
+-->
+
+* Type: {WritableStream}
+
[Streams]: stream.md
[WHATWG Streams Standard]: https://streams.spec.whatwg.org/