Skip to content

Exports

[<Class>]
type Exports =
    static member Network: Network
    static member NetworkResources: NetworkResources
    static member console: InspectorConsole
    static member Session () : Session
    static member ``open`` (?port: float, ?host: string, ?wait: bool) : Disposable
    static member close () : unit
    static member url () : string option
    static member waitForDebugger () : unit
AssemblyXantham.Fable.Node
Attributes[<Erase>]

The package's value exports, each bound to its import.

Properties

static member Network: Network
static member NetworkResources: NetworkResources
static member console: InspectorConsole

An object to send messages to the remote inspector console.

@since v11.0.0

Methods

static member Session () : Session

The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications.

@since v19.0.0

static member ``open`` (?port: float, ?host: string, ?wait: bool) : 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 regarding the host parameter usage.

Parameter
portPort to listen on for inspector connections. Defaults to what was specified on the CLI.
hostHost to listen on for inspector connections. Defaults to what was specified on the CLI.
waitBlock until a client has connected. Defaults to what was specified on the CLI.

Returns. Disposable that calls inspector.close().

static member close () : unit

Deactivate the inspector. Blocks until there are no active connections.

static member url () : string option

Return the URL of the active inspector, or undefined if there is none.

$ node --inspect -p 'inspector.url()'
Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
For help, see: https://nodejs.org/en/docs/inspector
ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34

$ node --inspect=localhost:3000 -p 'inspector.url()'
Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
For help, see: https://nodejs.org/en/docs/inspector
ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a

$ node -p 'inspector.url()'
undefined
static member waitForDebugger () : unit

Blocks until a client (existing or connected later) has sent Runtime.runIfWaitingForDebugger command.

An exception will be thrown if there is no active inspector.

@since v12.7.0