trait OS extends Object
Provides a few basic operating-system related utility functions.
- Annotations
- @JSType() @native()
- See also
https://nodejs.org/api/os.html
- Alphabetic
- By Inheritance
- OS
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def EOL: String
A constant defining the appropriate End-of-line marker for the operating system.
A constant defining the appropriate End-of-line marker for the operating system.
- \n on POSIX
- \r\n on Windows
os.EOL
Example: - def arch(): String
Returns the operating system CPU architecture.
Returns the operating system CPU architecture. Possible values are 'x64', 'arm' and 'ia32'. Returns the value of process.arch.
os.arch()
Example: - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def constants: OSConstants
Returns an object containing commonly used operating system specific constants for error codes, process signals, and so on.
Returns an object containing commonly used operating system specific constants for error codes, process signals, and so on. The specific constants currently defined are described in OS Constants.
- See also
https://nodejs.org/api/os.html#os_os_constants_1
- def cpus(): Array[CPUInfo]
Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq).
Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of milliseconds the CPU/core spent in: user, nice, sys, idle, and irq).
os.cpus()
Example: - def endianness(): String
Returns the endianness of the CPU.
Returns the endianness of the CPU. Possible values are 'BE' for big endian or 'LE' for little endian.
os.endianness()
Example: - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def freemem(): Double
Returns the amount of free system memory in bytes.
Returns the amount of free system memory in bytes.
os.freemem()
Example: - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getPriority(): Int
- def getPriority(pid: Int): Int
- def hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def homedir(): String
Returns the home directory of the current user.
Returns the home directory of the current user.
os.homedir()
Example: - def hostname(): String
Returns the hostname of the operating system.
Returns the hostname of the operating system.
os.hostname()
Example: - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- def loadavg(): Array[Int]
Returns an array containing the 1, 5, and 15 minute load averages.
Returns an array containing the 1, 5, and 15 minute load averages.
The load average is a measure of system activity, calculated by the operating system and expressed as a fractional number. As a rule of thumb, the load average should ideally be less than the number of logical CPUs in the system.
The load average is a very UNIX-y concept; there is no real equivalent on Windows platforms. That is why this function always returns [0, 0, 0] on Windows.
os.loadavg()
Example: - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def networkInterfaces(): Dictionary[Array[NetworkInterface]]
Get a list of network interfaces
Get a list of network interfaces
os.networkInterfaces()
Example: - final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def platform(): String
Returns the operating system platform.
Returns the operating system platform. Possible values are 'darwin', 'freebsd', 'linux', 'sunos' or 'win32'. Returns the value of process.platform.
os.platform()
Example: - def propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- def release(): String
Returns the operating system release.
Returns the operating system release.
os.release()
Example: - def setPriority(priority: Int): Unit
- def setPriority(pid: Int, priority: Int): Unit
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tmpdir(): String
Returns the operating system's default directory for temporary files.
Returns the operating system's default directory for temporary files.
os.tmpdir()
Example: - def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- def totalmem(): Double
Returns the total amount of system memory in bytes.
Returns the total amount of system memory in bytes.
os.totalmem()
Example: - def type(): String
Returns the operating system name.
Returns the operating system name. For example 'Linux' on Linux, 'Darwin' on OS X and 'Windows_NT' on Windows.
os.type()
Example: - def uptime(): Int
Returns the system uptime in seconds.
Returns the system uptime in seconds.
os.uptime()
Example: - def userInfo(): UserInfoObject
- def userInfo(options: UserInfoOptions): UserInfoObject
The os.userInfo() method returns information about the currently effective user -- on POSIX platforms, this is typically a subset of the password file.
The os.userInfo() method returns information about the currently effective user -- on POSIX platforms, this is typically a subset of the password file. The returned object includes the username, uid, gid, shell, and homedir. On Windows, the uid and gid fields are -1, and shell is null.
The value of homedir returned by os.userInfo() is provided by the operating system. This differs from the result of os.homedir(), which queries several environment variables for the home directory before falling back to the operating system response.
- returns
- def valueOf(): Any
- Definition Classes
- Object
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()