Skip to main content
Socket.prototype.setEncoding - net - Node documentation
method Socket.prototype.setEncoding

Usage in Deno

import { Socket } from "node:net";
Socket.prototype.setEncoding(encoding?: BufferEncoding): this

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.