Skip to main content
connect - net - Node documentation
function connect

Usage in Deno

import { connect } from "node:net";
connect(
options: NetConnectOpts,
connectionListener?: () => void,
): Socket

Aliases to createConnection.

Possible signatures:

Parameters

options: NetConnectOpts
optional
connectionListener: () => void

Return Type

connect(
port: number,
host?: string,
connectionListener?: () => void,
): Socket

Parameters

port: number
optional
host: string
optional
connectionListener: () => void

Return Type

connect(
path: string,
connectionListener?: () => void,
): Socket

Parameters

path: string
optional
connectionListener: () => void

Return Type