node-proc

Module to access Linux /proc information

Node-Proc

Module to access /proc data on Linux system

npm install node-proc
  • Expand Functions
  • Platform Independant Data Format
  • Cross-Platform Data Gathering

System Memory Usage in Bytes

proc.meminfo( callback )

callback( err, array meminfo )

Example

{ MemTotal: 383238144,
  MemFree: 38522880,
  Buffers: 8245248,
  Cached: 258404352,
  ...
}

System Processor(s) Information

proc.cpuinfo( callback )

callback( err, array cpuinfo )

Example

[ { processor: '0',
    vendor_id: 'GenuineIntel',
    model: '58',
    'model name': 'Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz',
    ...
  },
  ...
]

System Uptime

proc.uptime( callback )

callback( err, integer uptime, integer startTime )

Note: uptime is the seconds since system boot, and startTime is the unix timestamp of system boot.

Bytes and packets transferred by system network devices

proc.netdev( callback )

callback( err, array netdev )

Example

[ { device: 'lo',
    Rx: { bytes: '0', packets: '0' },
    Tx: { bytes: '0', packets: '0' } },
  { device: 'eth0',
    Rx: { bytes: '31931251', packets: '36785' },
    Tx: { bytes: '1438069', packets: '19862' } } ]