npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rndroid-advance-battery

v0.1.4

Published

An android only advance react native package that returns battery related data like percentage, voltage, ampere, wattage and more

Downloads

15

Readme

🔋 rndroid-advance-battery

An Android-only React Native package that provides detailed battery information such as percentage, status, health, voltage, current, wattage, and more — all through a simple API.

⚙️ Built as a Turbo Module for maximum performance.


📦 Installation

npm install rndroid-advance-battery

🚀 Usage

// Option 1: Import the full module
import Battery from 'rndroid-advance-battery';

// Option 2: Import specific functions
import { getLevel, getStatus, getHealth } from 'rndroid-advance-battery';

Now you can use any of the following async methods:

🔋 getLevel()

const level = await Battery.getLevel();
console.log(`Battery Level: ${level}%`);

Returns: Battery level (0–100).

⚡ getStatus()

const status = await Battery.getStatus();
console.log(`Status: ${status}`);

Returns: "Charging", "Discharging", "Full", "Not Charging", or "Unknown".

❤️ getHealth()

const health = await Battery.getHealth();
console.log(`Health: ${health}`);

Returns: Battery condition such as "Good", "Overheat", "Cold", etc.

🌡️ getTemperature()

const temp = await Battery.getTemperature();
console.log(`Temperature: ${temp} °C`);

Returns: Current battery temperature.

⚙️ getTechnology()

const tech = await Battery.getTechnology();
console.log(`Technology: ${tech}`);

Returns: Battery chemistry, e.g. "Li-ion".

🔌 isCharging()

const charging = await Battery.isCharging();
console.log(charging ? 'Charging' : 'Not Charging');

Returns: true if charging, else false.

⚙️ getCurrent()

const current = await Battery.getCurrent();
console.log(`Current: ${current} mA`);

Returns: Instantaneous current (mA). Positive when charging, negative when discharging.

⚙️ getVoltage()

const voltage = await Battery.getVoltage();
console.log(`Voltage: ${voltage} mV`);

Returns: Current voltage in millivolts.

⚙️ getWattage()

const wattage = await Battery.getWattage();
console.log(`Wattage: ${wattage} W`);

Returns: Real-time power draw in watts (calculated from voltage × current).

💾 getTotalCapacity()

const total = await Battery.getTotalCapacity();
console.log(`Total Capacity: ${total} mAh`);

Returns: Estimated total design capacity (mAh).

⚡ getChargedCapacity()

const charged = await Battery.getChargedCapacity();
console.log(`Charged Capacity: ${charged} mAh`);

Returns: Current charged capacity (mAh).

🧩 Example: Fetch All at Once

async function logBatteryInfo() {
  const data = {
    level: await getLevel(),
    status: await getStatus(),
    health: await getHealth(),
    temperature: await getTemperature(),
    technology: await getTechnology(),
    isCharging: await isCharging(),
    current: await getCurrent(),
    voltage: await getVoltage(),
    wattage: await getWattage(),
    totalCapacity: await getTotalCapacity(),
    chargedCapacity: await getChargedCapacity(),
  };

  console.log('Battery Info:', data);
}

logBatteryInfo();

📘 Quick Reference

| Method | Returns | Unit / Type | Description | | -------------------- | ------- | ----------- | -------------------------- | | getLevel() | number | % | Current battery level | | getStatus() | string | — | Charging/discharging state | | getHealth() | string | — | Battery condition | | getTemperature() | number | °C | Battery temperature | | getTechnology() | string | — | Battery technology | | isCharging() | boolean | — | Whether charging or not | | getCurrent() | number | mA | Current flow | | getVoltage() | number | mV | Voltage | | getWattage() | number | W | Power draw | | getTotalCapacity() | number | mAh | Total design capacity | | getChargedCapacity() | number | mAh | Current charged capacity |

License

MIT