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

gpx-mapper

v1.0.5

Published

Convert a directory of GPX files into a static website with an interactive map

Downloads

672

Readme

GPX Mapper

A Node.js CLI tool that converts a directory of GPX files into a static website with an interactive map. Perfect for cycling clubs to publish their frequent routes.

Features

  • Interactive Map: Routes displayed on OpenStreetMap vector tiles using MapLibre GL JS
  • Responsive Design: Two-pane layout on desktop (sidebar + map), dropdown selector on mobile
  • Route Details: Shows distance (km) and elevation gain (m) for each route
  • Shareable URLs: Link directly to specific routes
  • GPX Downloads: Each route includes a download link to the original GPX file
  • Unique Route Colors: Each route gets a distinct color for easy identification
  • Static Output: Generates a standalone website that can be hosted anywhere

Installation

npm install

Usage

npx gpx-mapper <input-dir> <output-dir> [options]

Options

| Option | Description | Default | |--------|-------------|---------| | -t, --title <title> | Site title | "Route Map" | | -V, --version | Show version number | | | -h, --help | Show help | |

Example

# Basic usage
npx gpx-mapper ./gpx ./dist

# With custom title
npx gpx-mapper ./gpx ./dist --title "EGCC Routes"

Output Structure

dist/
├── index.html      # Main HTML page
├── app.js          # Client-side JavaScript
├── routes.json     # Route data (loaded at runtime)
└── gpx/            # Copied GPX files for download
    ├── route1.gpx
    ├── route2.gpx
    └── ...

Viewing the Generated Site

The generated site must be served via HTTP (not opened directly as a file) because it fetches routes.json at runtime.

# Using npx serve
npx serve ./dist

# Or any other static file server
python -m http.server 8000 --directory ./dist

How It Works

  1. Build Time: The CLI parses all GPX files in the input directory, extracts route names, coordinates, distances, and elevation data
  2. Output: Generates a static website with the route data stored in routes.json
  3. Runtime: The client-side JavaScript fetches routes.json and renders routes on the map

GPX File Requirements

  • Standard GPX 1.1 format
  • Must contain at least one <trk> (track) with <trkpt> (track points)
  • Route name is extracted from <name> metadata (falls back to filename)
  • Elevation data (<ele>) is optional but enables elevation gain display

Browser Support

Works in all modern browsers that support:

  • ES6+ JavaScript
  • WebGL (for MapLibre GL JS)
  • Fetch API

Dependencies

Build-time (npm)

  • commander - CLI argument parsing
  • gpxparser - GPX file parsing
  • he - HTML entity decoding

Client-side (CDN)

  • MapLibre GL JS - Map rendering
  • OpenFreeMap tiles - Basemap tiles (Positron style)

License

MIT