Skip to content

kenany/battery-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

battery-path

Get the path to a battery. Probably only works on Linux.

Really simple module created to reduce code duplication across my battery modules. Changes to this module will seamlessly propagate to other modules that deal with batteries.

Example

var batteryPath = require('battery-path');

batteryPath('BAT0');
// => '/sys/class/power_supply/BAT0'

Installation

$ npm install battery-path

API

var batteryPath = require('battery-path');

batteryPath(battery)

Returns the String path to battery.