@zturnlibs/ztron-api


single-instance

Variables

singleInstance

const singleInstance: object

Defined in: single-instance.ts:27

Type Declaration

isPrimary

isPrimary: () => Promise<boolean> = isPrimaryInstance

Whether this process is the primary (first-launched) instance.

Returns

Promise<boolean>

onSecondInstance

onSecondInstance: (handler) => Promise<() => Promise<void>>

Listens for a second instance attempting to launch. The handler runs on the primary instance with the second instance's argv/cwd (argv is currently always empty).

Parameters
handler

(event) => void

Returns

Promise<() => Promise<void>>

Functions

isPrimaryInstance()

isPrimaryInstance(): Promise<boolean>

Defined in: single-instance.ts:9

Whether this process is the primary (first-launched) instance.

Returns

Promise<boolean>


onSecondInstance()

onSecondInstance(handler): Promise<() => Promise<void>>

Defined in: single-instance.ts:18

Listens for a second instance attempting to launch. The handler runs on the primary instance with the second instance's argv/cwd (argv is currently always empty).

Parameters

handler

(event) => void

Returns

Promise<() => Promise<void>>