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 🙏

© 2025 – Pkg Stats / Ryan Hefner

graphhopper

v2025.7.1-0.1

Published

A complete TypeScript client for the GraphHopper API, including Routing, Isochrone, Matrix, Map Matching, Optimization, and Geocoding modules.

Readme

GraphHopper TypeScript API

A TypeScript library for interacting with the GraphHopper API, including modules for Routing, Isochrone, Matrix, Map Matching, Optimization, and Geocoding. All modules are written in TypeScript and ready for use in Node.js and browser environments.

Installation

npm install graphhopper

Dependencies

  • axios is required for HTTP requests (installed automatically).

Usage Example

import {
  GraphHopperInput,
  GraphHopperRouting,
  GraphHopperIsochrone,
  GraphHopperMatrix,
  GraphHopperMapMatching,
  GraphHopperOptimization,
  GraphHopperGeocoding
} from 'graphhopper';

// Routing Example
const routing = new GraphHopperRouting({ key: 'YOUR_API_KEY' });
routing.doRequest({
  points: [[13.388860,52.517037],[13.397634,52.529407]],
  profile: 'car'
}).then(result => {
  console.log('Routing result:', result);
});

// Isochrone Example
const isochrone = new GraphHopperIsochrone({ key: 'YOUR_API_KEY' });
isochrone.doRequest({
  point: '52.517037,13.388860',
  time_limit: 600,
  profile: 'car'
}).then(result => {
  console.log('Isochrone result:', result);
});

// Matrix Example
const matrix = new GraphHopperMatrix({ key: 'YOUR_API_KEY' });
matrix.doRequest({
  from_points: [[13.388860,52.517037]],
  to_points: [[13.397634,52.529407]],
  profile: 'car'
}).then(result => {
  console.log('Matrix result:', result);
});

// Map Matching Example
const mapMatching = new GraphHopperMapMatching({ key: 'YOUR_API_KEY' });
mapMatching.doRequest('<gpx>...</gpx>').then(result => {
  console.log('Map Matching result:', result);
});

// Optimization Example
const optimization = new GraphHopperOptimization({ key: 'YOUR_API_KEY' });
optimization.doVRPRequest([[13.388860,52.517037],[13.397634,52.529407]], 1).then(result => {
  console.log('Optimization result:', result);
});

// Geocoding Example
const geocoding = new GraphHopperGeocoding({ key: 'YOUR_API_KEY' });
geocoding.doRequest({ query: 'Berlin' }).then(result => {
  console.log('Geocoding result:', result);
});

For more advanced usage and parameter options, see the GraphHopper OpenAPI documentation.

Modules

  • GraphHopperInput: Utility for lat/lng input and conversion.
  • GraphHopperRouting: Routing API client.
  • GraphHopperIsochrone: Isochrone API client.
  • GraphHopperMatrix: Matrix API client.
  • GraphHopperMapMatching: Map Matching API client.
  • GraphHopperOptimization: Vehicle Routing Problem (VRP) API client.
  • GraphHopperGeocoding: Geocoding API client.

TypeScript Support

All modules are fully typed. Import types for strict usage:

import { GraphHopperRoutingArgs } from 'graphhopper';

License

MIT


This TypeScript module was created by GitHub Copilot, based on the original JavaScript GraphHopper client. The code was modernized, typed, and refactored for npm and TypeScript best practices.