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

@jeongshin/react-native-keep-awake

v0.1.0-beta.0

Published

Keep the screen awake in React Native apps (New Architecture, Turbo Module)

Readme

@jeongshin/react-native-keep-awake

Keep the screen awake in React Native apps. Built as a Turbo Module for the New Architecture (React Native 0.76+, tested on 0.86).

Inspired by expo-keep-awake and @sayem314/react-native-keep-awake, without the Expo modules dependency.

  • iOS: toggles UIApplication.idleTimerDisabled
  • Android: toggles FLAG_KEEP_SCREEN_ON on the current activity window (re-applied automatically when the activity is recreated)
  • Tag-based reference counting: the screen stays awake while at least one tag is active, so independent features (player, upload, reading mode, ...) never release each other's lock

Installation

npm install @jeongshin/react-native-keep-awake
# or
yarn add @jeongshin/react-native-keep-awake

Then rebuild your app (pod install for iOS).

Requires the New Architecture. There is no legacy (Paper) implementation.

Usage

Hook

Keeps the screen awake while the component is mounted:

import { useKeepAwake } from '@jeongshin/react-native-keep-awake';

function PlayerScreen() {
  useKeepAwake();
  // ...
}

Each useKeepAwake() instance uses its own unique tag by default, so multiple screens/components can use it concurrently — the screen sleeps again only after the last one unmounts.

Component

import { KeepAwake } from '@jeongshin/react-native-keep-awake';

function Screen({ isPlaying }: { isPlaying: boolean }) {
  return (
    <>
      {isPlaying && <KeepAwake />}
      {/* ... */}
    </>
  );
}

Imperative API

import {
  activateKeepAwake,
  deactivateKeepAwake,
} from '@jeongshin/react-native-keep-awake';

activateKeepAwake('download');
// ... long running work ...
deactivateKeepAwake('download');

activate/deactivate calls with the same tag are idempotent (a tag is either active or not — activating twice does not require deactivating twice). Calling without a tag uses a shared default tag.

API

| Export | Description | | --- | --- | | useKeepAwake(tag?: string) | Keeps the screen awake while mounted. Uses a unique tag per hook instance unless tag is given. | | <KeepAwake tag?: string /> | Component wrapper around useKeepAwake. Renders nothing. | | activateKeepAwake(tag?: string) | Prevents the screen from sleeping until the same tag is deactivated. | | deactivateKeepAwake(tag?: string) | Releases the lock held by tag. | | DEFAULT_KEEP_AWAKE_TAG | Tag used when none is provided. |

Contributing

License

MIT


Made with create-react-native-library