battery-rate

3.0.0 • Public • Published

battery-rate

Get a battery's (dis)charge rate. Probably only works on Linux.

Example

const batteryRate = require('battery-rate');

batteryRate('BAT1', (error, rate) => {
  if (error) {
    throw error;
  }

  console.log(rate);
  // => -9.106
});

Installation

$ npm install battery-rate

API

const battery-rate = require('battery-rate');

battery-rate([battery='BAT0'], callback)

Calls callback(error, rate), where error is any Error encountered and Number rate is the current rate of charge/discharge in watts of String battery (which defaults to 'BAT0').

/battery-rate/

    Package Sidebar

    Install

    npm i battery-rate

    Weekly Downloads

    3

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    3.93 kB

    Total Files

    4

    Last publish

    Collaborators

    • kenan