is-charging

May 16, 2018 · View on GitHub

Find out if a computer is charging

Install

$ npm install is-charging

Usage

const isCharging = require('is-charging');

isCharging().then(result => {
	console.log(result);
	//=> true
});

API

isCharging()

Returns a promise that resolves in to a Boolean.

Related

  • is-charging-cli - CLI for this module
  • battery-level - Get current battery level
  • browser-battery - Get and watch battery information in a browser

License

MIT © Andreas Strandman

Contents

  1. 1Install
  2. 2Usage
  3. 3API
  4. 3.1isCharging()
  5. 4Related
  6. 5License