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

react-native-standby-bucket

v1.0.3

Published

Access your app's current Android App Standby bucket

Downloads

86

Readme

react-native-standby-bucket

Access your app's current Android App Standby bucket (ACTIVE, WORKING_SET, FREQUENT, RARE, RESTRICTED, etc.) from Expo or React Native so you can tune background work based on how the system ranks your app.

Installation

  1. Install the module:

    npx expo install react-native-standby-bucket
  2. Rebuild your native project:

    • Expo (managed): run npx expo prebuild and rebuild your Android app (EAS Build or expo run:android).
    • Bare React Native: rebuild the Android application as you normally would.
  3. No manifest changes required. The module works without any special permissions.

Usage

import { getStandbyBucket } from "react-native-standby-bucket";

const info = getStandbyBucket();

console.log(info.bucket);      // e.g. 10
console.log(info.bucketName);  // "ACTIVE"
console.log(info.supported);   // true on Android 9+

Or using the module directly (legacy):

import StandbyBucket from "react-native-standby-bucket";

const info = StandbyBucket.getAppStandbyBucket();

getStandbyBucket() runs synchronously and returns the current bucket as an AppStandbyBucketInfo object. You can also use StandbyBucket.getAppStandbyBucket() for the module approach.

  • bucket: the raw integer from UsageStatsManager.appStandbyBucket.
  • bucketName: one of EXEMPTED, ACTIVE, WORKING_SET, FREQUENT, RARE, RESTRICTED, NEVER, UNKNOWN, or UNSUPPORTED.
  • supported: true on Android 9+; otherwise false with bucket = -1 and bucketName = "UNSUPPORTED".

| Raw value | bucketName | Notes | |-----------|---------------|-------| | 5 | EXEMPTED | Android 11+ | | 10 | ACTIVE | | | 20 | WORKING_SET | | | 30 | FREQUENT | | | 40 | RARE | | | 45 | RESTRICTED | | | 50 | NEVER | Android 11+ | | other | UNKNOWN | |

Platform notes

  • Android 9+: Returns the real standby bucket with supported = true
  • Android < 9: Returns UNSUPPORTED response with supported = false
  • iOS/Web: Returns UNSUPPORTED response with supported = false (no errors thrown)

The module gracefully handles all platforms without requiring platform checks in your code.

Example app

A minimal demo lives in example/. To try it out:

cd example
bun install
npx expo run:android

The example app will immediately show your app's real standby bucket values.

Development

Install dependencies with Bun and build the module before sending changes:

bun install
bun run build

Then run the example app

cd example
bun install
npx expo run:android

The package is published under the MIT license.