Skip to main content
open - node__inspector--promises.d.ts - Node documentation
function open

Usage in Deno

```typescript import { open } from "node:node__inspector--promises.d.ts"; ```
open(
port?: number,
host?: string,
wait?: boolean,
): Disposable
Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has started. If wait is `true`, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. See the [security warning](https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure) regarding the `host` parameter usage.

Parameters

optional
port: number
Port to listen on for inspector connections. Defaults to what was specified on the CLI.
optional
host: string
Host to listen on for inspector connections. Defaults to what was specified on the CLI.
optional
wait: boolean
Block until a client has connected. Defaults to what was specified on the CLI.

Return Type

Disposable
Disposable that calls `inspector.close()`.