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

netsignal

v1.1.0

Published

Ultra-fast network state for React Native 0.80+ (New Architecture)

Readme

NetSignal

npm version npm downloads CI License: MIT React Native New Architecture Platform TypeScript bundle size

Ultra-fast network state for React Native 0.80+ (New Architecture Only, Android)

0.3ms latency | TurboModule powered | ~300 lines total

Requirements

  • React Native 0.80+
  • New Architecture enabled
  • Android only (iOS/Web not yet supported)
  • Kotlin 1.9+

Installation

npm install netsignal

Enable New Architecture

In android/gradle.properties:

newArchEnabled=true

Add Permission

In AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Usage

import NetSignal, { useNetworkState } from 'netsignal';

// Instant checks (0.3ms)
if (NetSignal.isConnected()) {
  console.log('Connected via:', NetSignal.getConnectionType());
}

// React component
function StatusBar() {
  const network = useNetworkState();
  if (!network.connected) return <Text>Offline</Text>;
  return <Text>Network: {network.type}</Text>;
}

API

Synchronous Methods (0.3ms)

NetSignal.isConnected()              // boolean
NetSignal.getConnectionType()        // "wifi" | "cellular" | "ethernet" | "none"
NetSignal.getActiveConnectionCount() // number
NetSignal.hasMultipleConnections()   // boolean
NetSignal.getSimpleSummary()         // all info in one call

Async Methods

const connections = await NetSignal.getAllActiveConnections();
// [{ type: "wifi", hasInternet: true, isMetered: false }]

Events

const unsubscribe = NetSignal.addEventListener((event) => {
  console.log('Network changed:', event.isConnected);
});

addEventListener runs in parallel with the hook store — if you also use useNetworkState (or a sibling hook), both your callback and the hook will fire on every native event. Pick one per component to avoid redundant work.

React Hooks

const network = useNetworkState();   // full state
const connected = useIsConnected();  // just boolean
const type = useConnectionType();    // just type

All hooks share a single native subscription via useSyncExternalStore.

Architecture

netsignal/
├── android/
│   ├── build.gradle
│   └── src/main/java/com/netsignal/
│       ├── NetSignalTurboModule.kt
│       └── NetSignalTurboPackage.kt
├── src/
│   ├── NativeNetSignal.ts          (Codegen spec)
│   └── index.tsx                   (JS API + hooks)
├── __tests__/                      (Jest test suite)
└── example/                        (Demo app)

Testing

npm test

21 tests covering all API methods, hooks, event subscriptions, and shared subscription behavior.

TypeScript

Full TypeScript support with strict types:

import NetSignal, {
  ConnectionType,
  NetworkState,
  Connection,
} from 'netsignal';

const type: ConnectionType = NetSignal.getConnectionType();
// "wifi" | "cellular" | "ethernet" | "none" | "unknown"

Why New Architecture Only?

  • 10x faster than old bridge (0.3ms vs 3ms)
  • Simpler code — no bridge complexity
  • Type safe — Codegen ensures correctness
  • Future proof — React Native's direction

License

MIT