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

@onekeyfe/react-native-background-thread

v6.7.0-32

Published

Background JavaScript runtime, shared storage and RPC bridge for OneKey

Readme

@onekeyfe/react-native-background-thread

A separate JavaScript runtime and shared native bridge for OneKey React Native applications on iOS and Android. The package exposes background runner startup, segment evaluation and runtime restart, together with primitive shared storage and inline RPC notifications.

Installation

yarn add @onekeyfe/react-native-background-thread

Install the application's iOS pods and rebuild the native application. Background startup also requires the application's native host and background entry bundle; this package does not create that entry or its module registry.

Usage

import {
  BackgroundThread,
  getSharedStore,
} from '@onekeyfe/react-native-background-thread';

BackgroundThread.installSharedBridge();
const store = getSharedStore();
store?.set('worker.status', 'ready');
const status = store?.get('worker.status');

getSharedStore() and getSharedRPC() can return undefined before the native bridge has been installed in the calling runtime. Shared values are strings, numbers or booleans; callers must serialize structured data themselves.

Runtime and bridge API

  • startBackgroundRunnerWithEntryURL(entryURL) starts the background entry.
  • loadSegmentInBackground(segmentId, path) evaluates a background segment.
  • restart('ui', reason) restarts only the UI JavaScript runtime.
  • restart('all', reason) restarts both JavaScript runtimes.
  • SharedStore exposes set, get, has, delete, keys, clear and size.
  • SharedRPC exposes write, onWrite and registerReadinessKey; notifications include both the call ID and primitive payload, without a read-back operation.

An all-runtime restart preserves the iOS process but replaces the Android process. Do not assume native singleton or service state survives on both platforms. Bundle switches must restart both runtimes so their module tables remain consistent. These differences and restart validation are documented in src/NativeBackgroundThread.ts.

Shared bridge readiness

SharedStore is a process bridge, not a JavaScript object shared between heaps. get(key) may return undefined; distinguish that from stored false, zero or an empty string. keys() returns strings and size is a read-only property. The exported ISharedStore and ISharedRPC types describe those surfaces.

SharedRPC delivers the call ID and payload together through onWrite. There is no read, has or pending-count API on that RPC object. registerReadinessKey(key) identifies the SharedStore key native teardown should clear for the calling runtime. Register and publish readiness in each runtime; a UI runtime's initialization does not establish background-runtime readiness.

License

MIT.