os

os

The os namespace provides operating system-related utility methods and properties.

Methods

(static) hostname() → {String}

Read the host name of the operating system.

Returns:

A string indicating the host name of the operating system.

Type
String

(static) networkInterfaces() → {Object}

Read network interfaces that have been assigned a network address.

Example
{
  lo: [
    {
      address: '127.0.0.1',
      netmask: '255.0.0.0',
      family: 'IPv4',
      mac: '00:00:00:00:00:00',
      internal: true,
      cidr: '127.0.0.1/8'
    },
    {
      address: '::1',
      netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      scopeid: 0,
      internal: true,
      cidr: '::1/128'
    }
  ],
  eth0: [
    {
      address: '192.168.1.108',
      netmask: '255.255.255.0',
      family: 'IPv4',
      mac: '01:02:03:0a:0b:0c',
      internal: false,
      cidr: '192.168.1.108/24'
    },
    {
      address: 'fe80::a00:27ff:fe4e:66a1',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: '01:02:03:0a:0b:0c',
      scopeid: 1,
      internal: false,
      cidr: 'fe80::a00:27ff:fe4e:66a1/64'
    }
  ]
}
Returns:

An object containing network interfaces.

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.

Type
Object

(static) platform() → {String}

Read the operating system platform.

Returns:

A string identifying the the operating system platform. Possible values are HMI, android, ios, and windows.

Type
String

Type Definitions

AssignedNetworkAddress

Properties:
Name Type Description
address String

The assigned IPv4 or IPv6 address.

netmask String

The IPv4 or IPv6 network mask.

family String

Either IPv4 or IPv6.

mac String

The MAC address of the network interface.

internal Boolean

true if the network interface is a loopback or similar interface that is not remotely accessible; otherwise false.

scopeid Number

The numeric IPv6 scope ID (only specified when family is IPv6).

cidr String

The assigned IPv4 or IPv6 address with the routing prefix in CIDR notation. If the netmask is invalid, this property is set to null.

Type:
  • Object