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

expo-running-kit

v1.0.0

Published

Expo native module for tracking running and walking workouts — GPS, pace, cadence, auto-pause, and laps.

Readme

expo-running-kit

A native Expo module for tracking running and walking workouts. Provides real-time GPS tracking, step counting, pace, cadence, auto-pause/resume, and lap recording — with a single React hook.

Features

  • GPS tracking — real-time position, speed, distance (metric or imperial)
  • Pedometer — step count and cadence (steps per minute)
  • Pace — current, average, and best pace with configurable units
  • Auto-pause / Auto-resume — pauses when you stop moving, resumes when you start again
  • Laps — record splits with per-lap distance, time, and pace
  • GPS quality indicator — excellent / good / fair / poor
  • iOS & Android — CoreLocation + CMPedometer on iOS, FusedLocation + StepCounter on Android

Installation

npx expo install expo-running-kit

iOS

npx pod-install

Add the following keys to your Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>Required to track your workout route.</string>
<key>NSMotionUsageDescription</key>
<string>Required to count your steps and measure cadence.</string>

Android

Add the following permissions to AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

Quick Start

import { useRunningKit } from 'expo-running-kit';

export default function WorkoutScreen() {
  const {
    sessionState,
    duration,
    distance,
    speed,
    pace,
    steps,
    gpsQuality,
    laps,
    summary,
    requestPermissions,
    startWorkout,
    pauseWorkout,
    resumeWorkout,
    stopWorkout,
    recordLap,
  } = useRunningKit({ units: 'metric', autoPause: true });

  return (
    // your UI
  );
}

API

useRunningKit(config?)

The main hook. Returns live workout data and control functions.

Config

| Option | Type | Default | Description | |---|---|---|---| | units | 'metric' \| 'imperial' | 'metric' | Distance in km/mi, pace in min/km or min/mi | | autoPause | boolean | false | Automatically pause when movement stops | | autoPauseDelay | number | 1 | Seconds after cadence drops to zero before pausing | | resumeThreshold | number | 30 | Minimum cadence (spm) to trigger auto-resume | | speedSmoothingWindow | number | 5 | Number of GPS samples to average for speed |

Returned values

| Value | Type | Description | |---|---|---| | sessionState | SessionState | Current workout state | | duration | number | Elapsed seconds (only counts while active) | | distance | number | Total distance in km or mi | | speed | SpeedStats | Current, average, and max speed in m/s | | pace | PaceStats | Current, average, and best pace as "M:SS" string | | steps | { total: number, cadence: number } | Total steps and cadence (spm) | | gpsQuality | GpsQuality | Signal quality: excellent / good / fair / poor | | laps | Lap[] | Recorded laps | | summary | SessionSummary \| null | Final stats after stopping |

Control functions

| Function | Description | |---|---| | requestPermissions() | Request location and motion permissions | | startWorkout(type) | Start a new workout ('running' or 'walking') | | pauseWorkout() | Manually pause | | resumeWorkout() | Resume from manual or auto-pause | | stopWorkout() | Stop and return SessionSummary | | recordLap() | Record a lap split |


Types

type SessionState = 'idle' | 'active' | 'paused' | 'auto-paused' | 'stopped';

type WorkoutType = 'running' | 'walking';

type GpsQuality = 'excellent' | 'good' | 'fair' | 'poor';

type SpeedStats = {
  current: number; // m/s
  avg: number;     // m/s
  max: number;     // m/s
};

type PaceStats = {
  current: string | null; // "5:30", null when stopped
  avg: string | null;
  best: string | null;
};

type Lap = {
  number: number;
  duration: number;   // seconds
  distance: number;   // km or mi
  avgSpeed: number;   // m/s
  avgPace: string | null;
};

type SessionSummary = {
  duration: number;  // seconds
  distance: number;  // km or mi
  steps: number;
  speed: SpeedStats;
  pace: PaceStats;
  calories: number;  // kcal (estimate)
  laps: Lap[];
};

Native Events (advanced)

If you need raw sensor data, you can subscribe to the native events directly:

import RunningKit from 'expo-running-kit';

const sub = RunningKit.addListener('onLocationUpdate', ({ latitude, longitude, speed, accuracy }) => {
  // raw GPS event
});

const sub2 = RunningKit.addListener('onStepUpdate', ({ steps, cadence }) => {
  // raw pedometer event
});

// cleanup
sub.remove();
sub2.remove();

Available events: onLocationUpdate, onStepUpdate, onSessionStateChange.


Auto-Pause Behaviour

When autoPause: true:

  • The native layer monitors cadence continuously — even while GPS is paused.
  • After ~3–4 seconds of zero cadence, the JS layer starts a short countdown (autoPauseDelay) then calls autoPauseWorkout() on the native side.
  • GPS stops during auto-pause to save battery; the step sensor keeps running to detect movement.
  • When cadence rises above resumeThreshold (default 30 spm), the workout resumes automatically and GPS restarts.
  • Manual pauseWorkout() stops both GPS and the pedometer; resumeWorkout() restarts both.

Platform Notes

| Feature | iOS | Android | |---|---|---| | GPS provider | CoreLocation | Fused Location Provider | | Step counting | CMPedometer | TYPE_STEP_COUNTER sensor | | Fast resume detection | CMPedometerEvent | Step sensor delta | | Background location | Not included | Not included |

Background location is intentionally out of scope — add expo-location background task if needed.


License

MIT