StringDecoder.prototype.end - Node documentation
method StringDecoder.prototype.end

Usage in Deno

import { StringDecoder } from "node:string_decoder";
StringDecoder.prototype.end(buffer?:
string
| Buffer
| ArrayBufferView
): string

Returns any remaining input stored in the internal buffer as a string. Bytes representing incomplete UTF-8 and UTF-16 characters will be replaced with substitution characters appropriate for the character encoding.

If the buffer argument is provided, one final call to stringDecoder.write()is performed before returning the remaining input. After end() is called, the stringDecoder object can be reused for new input.

Parameters

optional
buffer:
string
| Buffer
| ArrayBufferView

The bytes to decode.

Return Type

string