Have ideas to improve npm?Join in the discussion! »

    healthi

    4.3.2 • Public • Published

    healthi

    Downloads Code Style Build Status

    Simple module to get your PC's battery health

    Install

    Right now it supports mac and linux:

    npm install healthi

    Usage

    Healthi works with promises since version 2.0.0:

    Example 1: await

    const health = require('healthi')
    const battery = await health()
    console.log(battery.health) //=> 90.76078670529044

    Example 2: then

    const health = require('healthi')
    health()
    .then(console.log) //=> { currentCapacity: 5953,  originalCapacity: 6559,  health: 90.76078670529044 }
    .catch(console.log)

    Result

    The battery object has 3 attributes:

    {
      now,      // Example: 5953 mAh
      original, // Example: 6559 mAh
      health    // Example: 90.7 % (this is the current capacity compared to the original one)
    }

    Contribute

    JavaScript Style Guide

    Feel free to open an issue or a pull request

    Author

    me
    © 2017 Pablo Varela

    Install

    npm i healthi

    DownloadsWeekly Downloads

    6

    Version

    4.3.2

    License

    MIT

    Unpacked Size

    4.29 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar