You are reading 12.6.0. See this page in 13.4.1.
os
A Node.js-compatible implementation of the core os module
Titanium provides a number of shims and ports of core Node.js module functionality.
This module is intended to provide a Node-compatible port of the os core module.
More details on the Node.js API can be found in their os module documentation
Properties 2
Methods 17
Returns the operating system CPU architecture for which the binary was compiled. Possible values are return 'arm', 'arm64', 'ia32', 'x64', 'mips', and 'unknown'.
The return value is equivalent to process.arch. Relates strongly to Titanium.Platform.architecture.
Returns an array of objects containing information about each logical CPU core.
Returns a string identifying the endianness of the CPU for which the binary was compiled.
Possible values are 'BE' for big endian and 'LE' for little endian.
Related to Titanium.Codec.getNativeByteOrder() on Titanium.
Returns the amount of free system memory in bytes as an integer.
Returns the scheduling priority for the process specified by pid. If pid is not provided or is 0, the priority of the current process is returned.
Titanium's shim, will always return 0.
| Parameters | Type | Description |
|---|---|---|
| pid? | Number | The process ID to retrieve scheduling priority for. |
Returns the string path of the current user's home directory.
On Titanium, returns the same value as Titanium.Filesystem.applicationDataDirectory.
Returns the host name of the operating system as a string. On Titanium, this will return the value of Titanium.Platform.address
Returns an array containing the 1, 5, and 15 minute load averages.
On Titanium, the return value is always [0, 0, 0].
Returns an object containing network interfaces that have been assigned a network address.
Each key on the returned object identifies a network interface. The associated value is an array of objects that each describe an assigned network address.
On Titanium, an empty object ({}) is always returned.
Returns a string identifying the operating system platform. Possible values are 'android', 'iphone', 'ipad', 'windowsphone', and 'windowsstore'.
The return value is equivalent to process.platform.
On Titanium, this is equivalent to Titanium.Platform.osname.
Returns the operating system as a string.
On Titanium, this is equivalent to Titanium.Platform.version.
Attempts to set the scheduling priority for the process specified by pid. If pid is not provided or is 0, the process ID of the current process is used.
On Titanium, this method is a no-op.
| Parameters | Type | Description |
|---|---|---|
| pid? | Number | The process ID to set scheduling priority for. |
| priority | Number | The scheduling priority to assign to the process. |
Returns the operating system's default directory for temporary files as a string.
On Titanium, this is equivalent to Titanium.Filesystem.tempDirectory.
Returns the total amount of system memory in bytes as an integer.
On Titanium, this is equivalent to Ti.Platform.totalMemory.
Returns the operating system as a string.
On Titanium, this returns 'Darwin' for iOS, or 'Linux' for Android. May return 'Unknown' for others.
Returns the system uptime in number of seconds.
On Titanium, this is equivalent to Titanium.Platform.uptime.
Returns information about the currently effective user.
| Parameters | Type | Description |
|---|---|---|
| options? | EncodingOptions | Simple object with 1 field
|