Skip to main content

@rtorcato/js-common / process

process

Functions

getProcessId()

getProcessId(): number | undefined

Defined in: process/index.ts:11

Returns the current process ID (Node.js only).

Example

getProcessId() // 48213 (undefined in a browser)

Returns

number | undefined


getProcessUptime()

getProcessUptime(): number | undefined

Defined in: process/index.ts:26

Returns the current process uptime in seconds (Node.js only).

Example

getProcessUptime() // 12.482

Returns

number | undefined


getCwd()

getCwd(): string | undefined

Defined in: process/index.ts:42

Returns the current working directory (Node.js only).

Example

getCwd() // '/Users/ada/projects/app'

Returns

string | undefined


getProcessPlatform()

getProcessPlatform(): string | undefined

Defined in: process/index.ts:51

Returns the current process platform (Node.js only).

Returns

string | undefined


exitProcess()

exitProcess(code?): void

Defined in: process/index.ts:60

Exits the process with the given code (Node.js only).

Parameters

code?

number = 0

Exit code (default 0).

Returns

void


isCI()

isCI(): boolean

Defined in: process/index.ts:68

Returns true if the process is running in a CI environment (Node.js only).

Returns

boolean