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

@mikaello/gpxfaketimer

v0.1.0

Published

Create (or modify) timestamps in a GPX file

Readme

GPX fake timer

npm

Create timestamps for every trackpoint in a GPX file.

npm install @mikaello/gpxfaketimer

Example

import { createTimestampsEvenly } from "@mikaello/gpxfaketimer";

const exampleGpx = `
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.0">
  <name>Example gpx</name>
  <trk>
    <name>Example gpx</name>
    <number>1</number>
    <trkseg>
      <trkpt lat="46.57608333" lon="8.89241667">
        <ele>2376</ele>
      </trkpt>
      <trkpt lat="46.57619444" lon="8.89252778">
        <ele>2375</ele>
      </trkpt>
      <trkpt lat="46.57661111" lon="8.89344444">
        <ele>2376</ele>
      </trkpt>
    </trkseg>
  </trk>
</gpx>
`;

console.log(createTimestampsEvenly(exampleGpx, 0, 100000));
// => will return the same GPX file, only with <time>date here</time> inside every trkpt:

/*
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.0">
  <name>Example gpx</name>
  <trk>
    <name>Example gpx</name>
    <number>1</number>
    <trkseg>
      <trkpt lat="46.57608333" lon="8.89241667">
        <ele>2376</ele>
        <time>1970-01-01T00:00:00.000Z</time>
      </trkpt>
      <trkpt lat="46.57619444" lon="8.89252778">
        <ele>2375</ele>
        <time>1970-01-01T00:00:50.000Z</time>
      </trkpt>
      <trkpt lat="46.57661111" lon="8.89344444">
        <ele>2376</ele>
        <time>1970-01-01T00:01:40.000Z</time>
      </trkpt>
    </trkseg>
  </trk>
</gpx>
*/

API

  • createTimestampsEvenly(gpxContent: string, startTime: number, endTime: number) => string: returns the incoming gpxContent enriched with timestamps in every trkpt element. startTime and endTime are milliseconds since epoch.

  • createTimestampsFromSpeed(gpxContent: string, startTime: number, speed: number, unit?: "kmh" | "mph") => string: returns the incoming gpxContent enriched with timestamps calculated from the GPS distance between each track point at the given speed. unit defaults to "kmh".

CLI

npx @mikaello/gpxfaketimer input.gpx --output output.gpx

Options:

| Flag | Description | |------|-------------| | --output, -o | Output file (default: stdout) | | --start | Start time as ISO 8601 or Unix ms (default: now) | | --end | End time for evenly distributed mode | | --speed | Speed value for distance-based timing | | --unit | Speed unit: kmh or mph (default: kmh, requires --speed) | | --help, -h | Show help |

When --speed is provided, timestamps are calculated from GPS distances at that speed. Otherwise, timestamps are evenly distributed between --start and --end (default duration: 1 hour).

Utility functions

Not specific for GPX, but just as helper functions

getUniformDistribution(count: number, intervalStart: number, intervalEnd: number) => number[]: returns an array of length count with first element intervalStart and last element intervalEnd, all elements in between is evenly distributed between these extremeties.

Develop

You can use the ./example project to ease developing. Run npm run dev from that folder to start a Vite dev server that loads the code from this module with hot module replacement.

Contributions are welcome :-)