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/elevation

v0.37.2

Published

Typed client for the unmap DEM elevation API

Readme

@unmap/elevation

DEM elevation from the active unmap terrain release.

import { Elevation } from "@unmap/elevation";

const elevation = new Elevation({ key: "um_live_..." });
const [metres] = await elevation.get([-114.0719, 51.0447]);

Heights are metres. After global Mapterhorn activation, source datums, native resolutions and terrain/surface models vary; this is not a uniform bare-earth DTM. Before activation or after Canadian rollback, MRDEM reports CGVD2013 and 30 m resolution. Check /coverage.json for the active release. The client keeps returning an ordered (number | null)[]; null is missing data. Direct HTTP responses expose datum: "mixed", resolution: null, model: "mixed" and sampling metadata for Mapterhorn. Its z12 0.5 m height increment is encoding precision, not accuracy.

An unconfigured terrain archive throws ElevationError with status 404 and code not_found (terrain archive not configured). A terrain tile that will not decode is status 502 and code upstream_error (elevation sample failed). That 502 has no Retry-After. The client still retries it, on its own backoff. A coordinate the archive does not cover stays null. An unavailable selected global release throws status 503, code service_unavailable, without falling back to another DEM.

@unmap/sdk exposes the same object as unmap.elevation. Full documentation: https://unmap.dev/docs/apis/elevation.

Sight lines

@unmap/elevation/view is the model the registry's view-explorer block runs: what a window can see over the terrain tiles, with the Earth's curve and standard refraction. It is pure functions; you supply the tile loader, so the browser decodes with OffscreenCanvas and Node with an image library. Take the tile template from a terrain=on style's raster-dem source.

import { fanRays, groundHeights, readRay, viewShare } from "@unmap/elevation/view";

const home: [number, number] = [-114.2005, 51.0575];
const rays = fanRays(home, { from: 200, to: 305, step: 3 }, 130_000, 72);
const { ground, perRay } = await groundHeights(home, rays, loadTerrainTile);
const results = rays.map((ray, i) => readRay(ray, perRay[i]!, ground!, ground! + 4.5));
const share = viewShare(results); // 0 to 1 of the fan that reaches the mountains

Each tile is one billed /terrain call and is loaded once per groundHeights call however many samples fall in it; cache tiles in your loader to share them across homes. The terrain is bare ground in most Canadian cities, so buildings and trees do not block a view unless you add their heights to the samples.