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

@_molaidrislabs/react-native-internet-speed-test

v0.1.4

Published

JavaScript-first NDT7 client for React Native and React Native Web.

Readme

@_molaidrislabs/react-native-internet-speed-test

JavaScript-first NDT7 client for React Native and React Native Web.

Features

  • API parity with react-native-ndt7
  • no native code or platform setup
  • event-driven API only
  • works in React Native and React Native Web environments with fetch, URL, and WebSocket
  • lightweight package shape with a soft-cancel v1 controller

Installation

npm install @_molaidrislabs/react-native-internet-speed-test
yarn add @_molaidrislabs/react-native-internet-speed-test

This package currently pins @m-lab/ndt7 to the tested upstream version to avoid behavior drift.

API

import { Ndt7 } from '@_molaidrislabs/react-native-internet-speed-test';

const progressSub = Ndt7.addListener('progress', event => {
  console.log(event.phase, event.speedMbps);
});

const completeSub = Ndt7.addListener('complete', result => {
  console.log(result.downloadMbps, result.uploadMbps);
});

await Ndt7.startSpeedTest({ userAcceptedDataPolicy: true });
await Ndt7.stopSpeedTest();
const state = await Ndt7.getState();

progressSub.remove();
completeSub.remove();

Methods

  • startSpeedTest(options?) => Promise<{ state, alreadyRunning }>
  • stopSpeedTest() => Promise<void>
  • getState() => Promise<SpeedTestState>
  • addListener(event, listener) => EventSubscription

State lifecycle

  • idle
  • starting
  • running
  • stopping
  • completed then auto-resets to idle
  • failed then auto-resets to idle

If a test is already active, startSpeedTest() returns the current state with alreadyRunning: true.

Usage scenarios

1. Minimal fire-and-forget test

import { Ndt7 } from '@_molaidrislabs/react-native-internet-speed-test';

await Ndt7.startSpeedTest({
  userAcceptedDataPolicy: true,
});

2. Subscribe to progress and completion

import { Ndt7 } from '@_molaidrislabs/react-native-internet-speed-test';

const subscriptions = [
  Ndt7.addListener('stateChange', event => {
    console.log('state', event.state);
  }),
  Ndt7.addListener('progress', event => {
    console.log(`${event.phase}: ${event.speedMbps.toFixed(2)} Mbps`);
  }),
  Ndt7.addListener('complete', event => {
    console.log('done', event.downloadMbps, event.uploadMbps);
  }),
  Ndt7.addListener('error', event => {
    console.warn(event.code, event.message);
  }),
];

await Ndt7.startSpeedTest({ userAcceptedDataPolicy: true });

// Later
subscriptions.forEach(subscription => subscription.remove());

3. Best-effort cancellation

import { Ndt7 } from '@_molaidrislabs/react-native-internet-speed-test';

await Ndt7.startSpeedTest({ userAcceptedDataPolicy: true });

setTimeout(() => {
  void Ndt7.stopSpeedTest();
}, 2_000);

stopSpeedTest() is a soft cancel in v1. The controller invalidates the active run and returns state to idle, but underlying WebSocket shutdown is still best-effort.

4. Target a specific server or load balancer

import { Ndt7 } from '@_molaidrislabs/react-native-internet-speed-test';

await Ndt7.startSpeedTest({
  userAcceptedDataPolicy: true,
  protocol: 'wss',
  server: 'ndt.example.net',
  metadata: {
    client_name: 'my-app',
    client_version: '1.2.3',
  },
});

Or use a custom locate service:

await Ndt7.startSpeedTest({
  userAcceptedDataPolicy: true,
  loadbalancer: 'https://locate.example.net/v2/nearest/ndt/ndt7',
});