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

racetale-pace

v1.0.0

Published

Running maths with no dependencies: pace, finish time, Riegel race predictions, split plans, heart rate zones, spectator passing times and GPX start/finish trimming.

Readme

racetale-pace

Running maths with no dependencies, in TypeScript. The same code runs the free runner tools on the RaceTale blog: pace, finish time, race predictions, split plans, heart rate zones, spectator passing times and GPX start/finish trimming.

  • No dependencies, about 6 kB packed, tree-shakeable, ESM and CommonJS, types included.
  • Pure functions. Nothing is sent anywhere and nothing is stored.
  • Distances are kilometres and times are seconds inside; units only matter when you show a result.
npm install racetale-pace

Examples

import { formatDuration, paceFromTime, riegel, splitPlan, hrZones, toSeconds } from "racetale-pace";

// Pace needed for a 3:45 marathon, in seconds per km
const pace = paceFromTime(toSeconds(3, 45, 0), 42.195);
formatDuration(pace); // "5:20"

// A 25:00 5K, predicted for the marathon (Riegel, exponent 1.06)
formatDuration(riegel(25 * 60, 5, 42.195)); // "3:59:47"

// Split table for a 25:00 5K, one row per km
splitPlan({ distanceKm: 5, goalSeconds: 1500, unit: "km" })[0];
// { mark: 1, length: 1, splitSeconds: 300, cumulativeSeconds: 300, paceSeconds: 300 }

// Five heart rate zones from a max heart rate of 185
hrZones(185)[0];
// { zone: 1, name: "Very easy", fromPercent: 50, toPercent: 60, fromBpm: 93, toBpm: 111 }

When will a runner pass a spot? A 4:00 marathon starting at 09:00, a spectator at km 10 and km 30:

import { passingTimes } from "racetale-pace";

passingTimes({
  spotsKm: [10, 30],
  distanceKm: 42.195,
  goalSeconds: 4 * 3600,
  startMinutes: 9 * 60, // race start, minutes since midnight
  delayMinutes: 0, // time to reach the start line
  marginMinutes: 10, // arrive this much earlier
});
// [{ km: 10, passMinutes: 596.9, arriveMinutes: 586.9 }, ...]

Hide the first and last 200 m of a GPX track before sharing it:

import { trimRange } from "racetale-pace";

const range = trimRange(points, 200); // points: { lat, lon }[]
if (range) share(points.slice(range.from, range.to + 1));

What is in it

| Area | Functions | | ------------- | -------------------------------------------------------------------------------------------------------- | | Pace and time | paceFromTime, timeFromPace, distanceFromPace, paceInUnit, speed, toSeconds, formatDuration | | Units | KM_PER_MILE, toKm, fromKm, DISTANCES (5K to 50K) | | Predictions | riegel (T2 = T1 x (D2 / D1)^1.06, optimistic for a first marathon) | | Splits | splitPlan (even, positive or negative split), timeShare, secondsAtDistance | | Spectators | passingTimes, formatClock, parseSpots | | Heart rate | estimateMaxHr (208 - 0.7 x age), hrZones (percent of max, or Karvonen with a resting rate) | | GPX | distanceMeters, trackLength, trimRange |

These are estimates for planning, not medical or coaching advice.

Links

  • Free tools in the browser: https://blog.racetale.com/tools/
  • RaceTale, the shared race-story app: https://racetale.com/

MIT licence.