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

@metasora/react-native-screen-utils

v0.1.5

Published

React Native screen awake and brightness control modules for navigation and maps

Readme

@metasora/react-native-screen-utils

npm version CI license platform

Screen awake and brightness control for React Native, with React Navigation hooks out of the box.

Built by Metasora · metasora.com

Use Cases

Navigation & Maps

When building navigation or map screens in React Native, users often need the screen to stay fully visible at maximum brightness — for example, following turn-by-turn directions while driving. This package handles that automatically:

  • Keep the screen awake so it doesn't lock while the user is navigating
  • Maximize brightness while the navigation screen is active, then restore the previous brightness when the user leaves

Just drop in the hooks and your navigation screen handles the rest.

QR Code & Barcode Scanning

Bright screens scan faster. When users open a scanner screen, maximize brightness so the camera can read codes even in low-light environments — then restore their preferred brightness when they're done.

Media & Video Playback

Prevent the screen from locking during video playback, live streams, or video calls without requiring users to manually adjust their device's auto-lock settings.

Features

  • ScreenAwake — Prevent the screen from dimming or locking
  • ScreenBrightness — Set, get, and reset screen brightness
  • React Navigation HooksuseScreenAwake and useScreenBrightness for automatic lifecycle management
  • Bridge Compatible — Works with both Old and New Architecture via RN interop layer
  • Zero Config — Autolinking on both platforms, no native setup required

Installation

# npm
npm install @metasora/react-native-screen-utils

# yarn
yarn add @metasora/react-native-screen-utils

# pnpm
pnpm add @metasora/react-native-screen-utils

# bun
bun add @metasora/react-native-screen-utils

iOS

cd ios && pod install

Android

No additional steps — autolinking handles everything.

Usage

Screen Awake

import { ScreenAwake } from '@metasora/react-native-screen-utils';

ScreenAwake.activate();
ScreenAwake.deactivate();

Screen Brightness

import { ScreenBrightness } from '@metasora/react-native-screen-utils';

await ScreenBrightness.setBrightness(1.0);    // Max brightness
const level = await ScreenBrightness.getBrightness();
ScreenBrightness.resetBrightness();            // Restore system default

React Navigation Hooks

Hooks activate on screen focus and clean up on blur automatically.

import { useScreenAwake, useScreenBrightness } from '@metasora/react-native-screen-utils';

function MapScreen() {
  useScreenAwake();         // Keep screen on while viewing
  useScreenBrightness();    // Max brightness while focused, restores on blur

  return <MapView />;
}

Note: Hooks require @react-navigation/native as a peer dependency.

API Reference

ScreenAwake

| Method | Description | |--------|-------------| | activate() | Prevent the screen from sleeping | | deactivate() | Allow the screen to sleep normally |

ScreenBrightness

| Method | Description | |--------|-------------| | setBrightness(value) | Set brightness level (0.01.0) | | getBrightness() | Get current brightness. Android returns -1 for system default | | resetBrightness() | Reset to system default brightness |

Hooks

| Hook | Description | |------|-------------| | useScreenAwake() | Keeps screen awake while the screen is focused. Re-activates on app foreground | | useScreenBrightness() | Sets max brightness while focused. Saves and restores previous brightness on blur |

Requirements

  • React Native 0.71+
  • iOS 15.1+
  • Android API 24+

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

MIT © Metasora