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

humboldt

v2.2.1

Published

some common tools for map, coordinates and co

Readme

Humboldt 🗺🤵🏻

Build Status npm version codecov

some common tools for map. Convert coordinates etc.

For example interfaces of markers to show on a map. And functions to convert between coordinate formats (degrees to degree minutes).

General

Coordinates

At first a really short and rough explaination of coordinates and their types and formats.

Different formats to express coordinates:

  • Degrees (D) e.g. 48.137222°
  • Degree Minutes (DM) e.g. 48° 8.233'
  • Degree Minutes Seconds (DMS) e.g. 48° 8' 13.9992"

A Geolocation is a set of two coordinates: Latitude and Longitude. For latitude the north or south position and for longitude the east or west position.

My favorite format to represent a geolocation is using compass signs (North / South, East / West) and degree minutes:

N 48° 08.233' E 11° 034.533' (Munich, Germany)
S 22° 54.500' W 43° 011.783' (Rio de Janeiro, Brazil)

Another popular representation like Google Maps is using is just both decimal degrees with latitude at first, followed by longitude and separated by a comma or simicolon.

48.137222; 11.575556

If there is no information of compass signs, North and east have positive degrees. South and west will be negative. For example for Rio de Janeiro -22.908333; -43.196389

Features

Coordinate Class

initialize with LatLng, DM, UTM. Then all different formats accessable as properties.

Coordinates {
    static fromDD(dd: LatLng): Coordinates;
    static fromDM(dm: DegreeMinutes): Coordinates;
    static fromDMS(dms: DegreeMinuteSeconds): Coordinates;
    static fromUTM(utm: Utm): Coordinates;

    dd: LatLng;
    dm: DegreeMinutes;
    dms: DegreeMinuteSeconds;
    utm: Utm;
}

CoordinateHelper

  • parse and validate geo coordinates in string of DM format
  • Convert LatLng <=> DM
  • Convert LatLng <=> DMS
  • Convert LatLng <=> UTM
/*
    "N 48° 08.233' E 011° 34.533'"
    =>
        {
            latitude: {
                hemisphere: "N",
                degree: 48,
                minutes: 8.233
            },
            longitude: {
                hemisphere: "E",
                degree: 11,
                minutes: 34.533
            }
        }
*/
static parseDegreeMinute(coordinate: string) : DegreeMinute | null

/*
    "N 48° 08.233' E 011° 34.533'" => true
*/
static validateDegreeMinute(coordinate: string) : boolean

/*
    "N 48° 08.233' E 011° 34.533'" => { latitude: 48.137217, longitude: 11.575550 }
*/
static coordinateDmStringToLatLng(coordinate: string): LatLng | null

/*
    { latitude: 48.137217, longitude: 11.575550 }
    <=>
    {
        latitude: {
            hemisphere: "N",
            degree: 48,
            minutes: 8.233
        },
        longitude: {
            hemisphere: "E",
            degree: 11,
            minutes: 34.533
        }
    }
*/
static coordinateLatLngToDm(latlng: LatLng) : DegreeMinute
static coordinateDmToLatLng(dm: DegreeMinutes): LatLng

/*
    { latitude: 48.137217, longitude: 11.575550 }
    <=>
    {
        latitude: {
            hemisphere: "N",
            degree: 48,
            minutes: 8,
            seconds: 13.98
        },
        longitude: {
            hemisphere: "E",
            degree: 11,
            minutes: 34,
            seconds: 31.98
        }
    }
*/
static coordinateLatLngToDMS(latlng: LatLng): DegreeMinuteSeconds
static coordinateDMSToLatLng(dms: DegreeMinuteSeconds): LatLng

/*
    { latitude: 48.137217, longitude: 11.575550 }
    <=>
    {
        zoneNumber: 32,
        zoneLetter: 'U',
        easting: 691607.433,
        northing: 5334759.818
    }
*/
static coordinateLatLngToUtm(latlng: LatLng): Utm
static coordinateUtmToLatLng(utm: Utm): LatLng