OperatingSystemAPI

Node API: os

Describes the API provided by the Node API built-in os module, which supplies operating system-related utilities, such as load averages, OS constants, resource usage, and more. Access to these methods is moderated by the active Elide security policy specified by the user.

 

Summary

The default implementation of the os module supplies cross-platform logic, which works on POSIX and Win32-style systems. Operating system APIs are called on-demand. Where access is not granted to such APIs, mock or stubbed values are supplied, or errors throw, as applicable.

Properties

Link copied to clipboard

Returns an object containing commonly-used operating system constants for error codes, process signals, and more.

Link copied to clipboard
abstract val devNull: String

The path to the operating system's null device.

Link copied to clipboard
abstract val EOL: String

The end-of-line marker used by the operating system.

Link copied to clipboard
abstract val family: OSType

Type of operating system this instance implements calls for; not exposed to the guest VM.

Functions

Link copied to clipboard
abstract fun arch(): String

Returns the architecture of the operating system.

Link copied to clipboard
abstract fun availableParallelism(): Int

Returns the number of logical CPUs available to the Node.js instance.

Link copied to clipboard
abstract fun cpus(): List<CPUInfo>

Returns an array of objects containing information about each CPU/core installed on the system.

Link copied to clipboard
abstract fun endianness(): String

Returns the endianness of the CPU.

Link copied to clipboard
abstract fun freemem(): Long

Returns the amount of free system memory in bytes.

Link copied to clipboard
abstract fun getPriority(pid: Value? = null): Int

Returns the scheduling priority of a process, specified by its process ID.

Link copied to clipboard
abstract fun homedir(): String

Returns the path to the current user's home directory.

Link copied to clipboard
abstract fun hostname(): String

Returns the hostname of the operating system.

Link copied to clipboard
abstract fun loadavg(): List<Double>

Returns an array containing the 1, 5, and 15 minute load averages.

Link copied to clipboard

Returns an object containing information about the network interfaces on the system.

Link copied to clipboard
abstract fun platform(): String

Returns the operating system platform.

Link copied to clipboard
abstract fun release(): String

Returns the operating system release.

Link copied to clipboard
abstract fun setPriority(pid: Value? = Value.asValue(0), priority: Value? = Value.asValue(PRIORITY_NORMAL))

Sets the scheduling priority of a process, specified by its process ID.

Link copied to clipboard
abstract fun tmpdir(): String

Returns the operating system's default directory for temporary files.

Link copied to clipboard
abstract fun totalmem(): Long

Returns the total amount of system memory in bytes.

Link copied to clipboard
abstract fun type(): String

Returns the operating system name.

Link copied to clipboard
abstract fun uptime(): Double

Returns the system uptime in seconds.

Link copied to clipboard
abstract fun userInfo(options: UserInfoOptions? = null): UserInfo?

Returns information about the current user.

Link copied to clipboard
abstract fun version(): String

Returns the operating system version.