OptionalencodingThe encoding to use when data is a string.
Supported encodings:
'utf8' / 'utf-8' (default): UTF-8 text encoding'ascii': Raw byte conversion for write operations'base64': Base64-encoded data decoded to bytes before sending'base64url': URL-safe Base64 decoded to bytes before sending'hex': Hexadecimal string decoded to bytes before sendingUnsupported values are rejected. When writing an ArrayBuffer, this option is ignored.
OptionaltagsOptional key-value pairs for metrics collection and logging. These tags will be attached to write-related metrics for this specific operation.
Tags specified here will be merged with socket-level and connection-level tags. Operation-level tags take highest priority for duplicate keys.
Configuration options for writing data to a TCP socket.
Example