Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SystemInfo

Hierarchy

  • SystemInfo

Index

Constructors

constructor

Properties

Private system

system: any

Methods

close

  • close(): void
  • Closes the connection to the SMC.

    Returns void

getBatteryCount

  • getBatteryCount(): number
  • Returns the number of batteries.

    Returns number

getBatteryCycles

  • getBatteryCycles(): number
  • Returns the cycles of the battery.

    Returns number

getBatteryHealth

  • getBatteryHealth(): number
  • Returns the health of the battery in percent.

    Returns number

getCpuTemp

  • getCpuTemp(): number
  • Returns the current temperature of the cpu in degrees celcius.

    Returns number

getCpuUsage

  • getCpuUsage(): number[]
  • Returns the current cpu usage in percent of the user, system, idle and nice in an array with this order.

    Returns number[]

getCurrentFanSpeed

  • getCurrentFanSpeed(fanId: number): number
  • Returns the current rpm of the fan.

    Parameters

    • fanId: number

      The fan id

    Returns number

getFanCount

  • getFanCount(): number
  • Returns the number of fans of the machine.

    Returns number

getKeyInfo

  • Returns information about the given SMC key. If the given key does not exist an exception is thrown.

    Parameters

    • key: string

      The SMC key

    Returns IKeyInfo

getMaxFanSpeed

  • getMaxFanSpeed(fanId: number): number
  • Returns the maximum rpm of the fan.

    Parameters

    • fanId: number

      The fan id

    Returns number

getMemoryUsage

  • getMemoryUsage(): number[]
  • Returns the current ram usage in gigabyte. The function returns an array with 5 values: [free, active, inactive, wired, compressed]

    Returns number[]

getMinFanSpeed

  • getMinFanSpeed(fanId: number): number
  • Returns the minimum rpm of the fan.

    Parameters

    • fanId: number

      The fan id

    Returns number

getTotalMemory

  • getTotalMemory(): number
  • Returns the total amount of ram in gigabyte.

    Returns number

isOnAc

  • isOnAc(): boolean
  • Returns true if the machine is on AC and returns false otherwise.

    Returns boolean

open

  • open(): void
  • Opens a new connection to the SMC.

    Returns void

Generated using TypeDoc