Methods
(async) toBuffer() → {Buffer}
Dump the stream content to a buffer. This will consume the stream.
Returns:
- the plaintext in Buffer form.
- Type
- Buffer
(async) toFile(filepath, encoding)
Dump the stream content to a local file. This will consume the stream.
Parameters:
Name | Type | Description |
---|---|---|
filepath |
string | the path of the local file to write plaintext to. |
encoding |
string | the charset encoding to use. Defaults to utf-8. |
(async) toString(encoding) → {string}
Dump the stream content to a string. This will consume the stream.
Parameters:
Name | Type | Description |
---|---|---|
encoding |
string | the charset encoding to use. Defaults to utf-8. |
Returns:
- the plaintext in string form.
- Type
- string