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

@unmap/sdk

v0.37.2

Published

One key, the whole unmap platform: map + geocoder + router

Readme

@unmap/sdk

One key, the whole unmap platform: a worldwide MapLibre GL basemap, Canadian geocoding and routing, and the rest of the API behind a single um_live_ or um_test_ key. The basemap supports 41 upstream Protomaps label-language tags; geocoding and routing remain Canada-scoped. Canadian-built, privacy-first.

npm i @unmap/sdk
import { Unmap } from '@unmap/sdk'
import 'maplibre-gl/dist/maplibre-gl.css'

const map = new Unmap({ key: 'um_live_...', container: '#map', center: [-114.07, 51.05] })

That is the whole Hello World: a worldwide basemap initially centered on Calgary in the #map element. Without a container you still get the geocoder and router:

const unmap = new Unmap({ key: 'um_live_...' })

await unmap.geocoder.search('Calgary Tower')
await unmap.geocoder.nearby('pharmacy', { near: [-114.07, 51.05] })
await unmap.router.route([-114.07, 51.05], [-113.99, 51.05], { mode: 'bicycle' })
await unmap.router.isochrone([-114.07, 51.05], { minutes: [10, 20] })

The SDK also carries the departure-time transit contract:

await unmap.router.route(from, to, { mode: 'transit', departAt: new Date() })

unmap.router.isochrone(near, { minutes, mode: 'transit', departAt }) draws transit travel-time bands the same way. Production routes the agencies /coverage.json lists as routing-ready. The type requires departAt; there is no arriveBy, transit matrix, or realtime claim.

Static transit data has its own release gate and client:

const stops = await unmap.transit.nearbyStops([-79.3832, 43.6532], { radius: 800 })
const departures = stops.data[0]
  ? await unmap.transit.departures(stops.data[0].id, { at: new Date(), window: 60 })
  : undefined

await unmap.transit.agencies()
await unmap.transit.getStop('um:transit:stop:ttc:1234')
await unmap.transit.getRoute('um:transit:route:ttc:1')

Those methods return { data, meta }, where meta carries source, freshness and attribution. They return a retryable 503 until a versioned GTFS release is enabled. Departures are scheduled, including service after midnight and calendar_dates.txt exceptions; they are not realtime.

The named Canadian layer catalog and your own overlays:

const layers = await unmap.layers.list({ jurisdiction: 'CA-AB' })
const soils = await unmap.layers.get('agriculture.soils') // licence, attribution, known_gaps, addon

const { overlay } = await unmap.byod.upload(file, { name: 'Service areas' })
new Unmap({ key: 'um_live_...', container: '#map', overlays: [overlay] })

upload() returns the whole record; overlay is the byod:<id> token that overlays takes. A File goes as multipart, a plain object as GeoJSON, raw bytes as PMTiles. Upload, list and delete with a server key (um_sk_): a browser key only reads an overlay by id, and the rest is a 403 server_key_required.

Canadian ski areas, with the Ski add-on:

const { data, meta } = await unmap.ski.areas({ province: 'BC', activity: 'downhill', q: 'whistler' })
const { data: area } = await unmap.ski.area(data[0].id) // elevation, runs, lifts, aspect, drive
const { data: lifts } = await unmap.ski.lifts3d(area.id) // stations, pylons and cable as [lng, lat, z]
const { data: { features } } = await unmap.ski.features(area.id) // runs and lifts with stable ids

The data is derived from OpenStreetMap and is ODbL: show meta.attribution with it. It is terrain information, not avalanche or safety advice. A key without the add-on gets a SkiError 403 addon_required, with the SKU in addon.

Modelled urban noise for Canada's 41 census metropolitan areas, with the Urban Noise add-on:

const { data, meta } = await unmap.noise.point({ lat: 51.054, lng: -114.0884 })
// data.lden, data.lnight (dB), data.score and data.label ("Quiet" … "Severe"),
// data.exceeds_who, data.dominant_source, data.sources_db, data.city (the metropolitan area),
// data.input_tier (1 counted traffic and measured heights, 2 counted traffic, 3 default traffic)

Every census metropolitan area, St. John's to Nanaimo; a point outside them throws a NoiseError 422 outside_coverage with the 41 covered areas in cities. A hexagon with no modelled source has lden: null, never 0 dB. The levels are derived from OpenStreetMap and are ODbL: show meta.attribution with them. They are modelled, not measured.

Without a build step

The same SDK loads from a script tag, with MapLibre already inside it:

<link rel="stylesheet" href="https://cdn.unmap.dev/sdk/0.37.2/unmap.css">
<div id="map" style="height: 400px"></div>
<script src="https://cdn.unmap.dev/sdk/0.37.2/unmap.js"></script>
<script>
  unmap.createMap({ key: 'um_live_...', container: '#map', center: [-114.07, 51.05] })
</script>

Everything above is on the unmap global: unmap.Unmap, unmap.Geocoder, unmap.Router, unmap.maplibregl. Pin the exact version in production; /sdk/0.37/ follows patches and /sdk/latest/ follows everything.

Options

| Option | Type | Notes | | ----------- | ----------------------- | ---------------------------------------------------------------------------- | | key | string | Required. | | gateway | string | API base URL. Defaults to https://api.unmap.dev. | | container | string \| HTMLElement | Mount a map here. Omit for geocoding and routing only. | | style | string | base (default), muted, outdoor, blueprint, blush, orchid, canopy, lagoon, tropic, sunset, bold, pastel, or a full style URL. | | mode | string | light or dark. Selects the mode of the named style. | | lang | string | Basemap label language. Supports the 41 Protomaps language tags (including ja, ko, zh-Hans, and zh-Hant); omit to follow the browser's Accept-Language. | | theme | string | A theme code (u… or ut1.) from unmap.dev/create. | | center | [lng, lat] | Initial centre. | | zoom | number | Initial zoom. | | projection | 'globe' \| 'mercator' | 'globe' (the default) draws the map as a sphere; 'mercator' is the flat map. | | controls | boolean \| { position } | Zoom and compass buttons. true by default; false for a bare canvas. |

The instance exposes .map (MapLibre GL Map, only with a container), .geocoder (@unmap/geocoding), .router (@unmap/routing), .transit, .places, .roads, .feedback and .elevation. Everything from the packages and @unmap/maps is re-exported here, including maplibregl for markers and popups.

Stylesheet

MapLibre's CSS is needed for controls, attribution, markers, and popups. Import maplibre-gl/dist/maplibre-gl.css once, near the root of your app. maplibre-gl arrives as a transitive dependency; under pnpm's strict layout add it as a direct dependency so the import resolves.

Web worker

MapLibre 6 parses tiles in a module worker and locates it through import.meta.url, which does not reliably resolve inside a bundler's module graph. Bundler users make a one-time setWorkerUrl() call after copying maplibre-gl-worker.mjs into their own public/. Skip it and the map never finishes loading, with no error thrown and no failed request — see @unmap/maps for the script and the call, or the quickstart.

Docs

Documentation en français : unmap.dev/fr/docs.