Socket.prototype.setEncoding - Node documentation
method Socket.prototype.setEncoding

Usage

import { Socket } from "node:net";

Set the encoding for the socket as a Readable Stream. See readable.setEncoding() for more information.

Parameters

optional
encoding: BufferEncoding

Return Type

this

The socket itself.