Quark #

Modules #

Quark v1.2.0 Documentation


quark/os #

Enum: NetworkInterface #

NetworkInterface #

  • kNone None
  • kETH Ethernet
  • kMobile Mobile
  • k2G Mobile 2G
  • k3G Mobile 3G
  • k4G Mobile 4G
  • k5G Mobile 5G

arch() #

Get CPU arch type

name() #

Get OS name, For: Android/iOS/MacOSX/Linux

version() #

Get OS version info

brand() #

Get the Device brand, For: Apple/Huawei

model() #

Get OS model, iPad‌/iPhone‌/Mac16,10

info() #

Get OS information

For example:

// Prints:
// sysname: Louis-iPhone
// sysname: Darwin
// machine: iPhone7,2
// nodename: Louis-iPhone
// version: Darwin Kernel Version 16.6.0: Mon Apr 17 17:33:35 PDT 2017; root:xnu-3789.60.24~24/RELEASE_ARM64_T7000
// release: 16.6.0
console.log(os.info());

languages() #

Get List of OS supported languages, May value is 'en-us'|'zh-cn'|'zh-tw'

isWifi() #

Is it a wifi network type?

isMobile() #

Is it a mobile network type?

networkInterface() #

Get the network interface

isAcPower() #

Is there an external power supply connected?

isBattery() #

Is there a battery device?

batteryLevel() #

Get battery power percentage if have a battery

memory() #

Get the memory total

usedMemory() #

Get the used memory size

availableMemory() #

Get the available memory size

cpuUsage() #

Get CPU usage percentage