Skip to main content
connect - node__net.d.ts - Node documentation
function connect

Usage in Deno

```typescript import { connect } from "node:node__net.d.ts"; ```
connect(
options: NetConnectOpts,
connectionListener?: () => void,
): Socket
Aliases to [createConnection](../.././node__net.d.ts/~/createConnection). Possible signatures: * [connect](../.././node__net.d.ts/~/connect) * [connect](../.././node__net.d.ts/~/connect) for `IPC` connections. * [connect](../.././node__net.d.ts/~/connect) for TCP connections.

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