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

altpbf

v1.1.1

Published

ALTPBF — a tiny binary format for elevation tiles: delta-coded SVarint grids with deflate-raw, decoded straight into Int16Array (no intermediate JS arrays). The elevation backbone of ortho-earth: 8 tiles / 55 MB cover the whole planet at R90. Encode, deco

Readme

altpbf

npm license: MIT

Repo layout note — development happens in the ortho-earth monorepo (packages/altpbf); this standalone repo is a read-only mirror synced on each release. Issues are welcome here; patches land in the monorepo. / 開発はモノレポ側で行い、ここはリリースごとに同期される公開ミラーです(Issue歓迎・変更はモノレポへ)。

A tiny binary format for elevation tiles. Heights are stored as delta-coded SVarint grids compressed with deflate-raw, and decoded straight into an Int16Array — no intermediate JS arrays (a 5.7M-point tile decodes in ~21 ms / +12 MB instead of ~99 ms / +230 MB).

This is the elevation backbone of ortho-earth: eight R90 tiles — 55 MB total — cover the entire planet, cached once in IndexedDB and re-read with zero network. Everything runs in the browser. MIT.

import { encode, decode, encodeName, decodeName, altpbf2png } from "altpbf";

// encode: an elevation grid → compressed binary (Blob-ready buffer)
const bin = await encode({
  name: encodeName(139, 35, 1),   // → "R01N035E139"  (1° tile at 35N 139E)
  source: "GSI DEM10B",
  lng: 139, lat: 35, range: 1,    // origin (bottom-left) and span in degrees
  width: 1200, height: 1200,
  data: heights,                  // Int16Array (or array) of meters, row-major
});

// decode: binary → { name, source, lng, lat, range, width, height, data: Int16Array }
const tile = await decode(new Blob([bin]));

// quick-look PNG (hypsometric tint by default, pass { colorMap } to restyle)
const png = await altpbf2png(new Blob([bin]), { size: 256 });

Name scheme

R{span:2}{N|S}{lat:3}{E|W}{lng:3} — R01N035E139 is the 1°×1° tile with its bottom-left corner at 35°N 139°E; R90S090W180 is a 90° quadrant. encodeName / decodeName round-trip it.

Scope

This package is the format: encode, decode, naming, preview. Data acquisition (which DEM, which bucket, which cache) is deliberately out of scope — bring your own tiles from GSI DEM10B, JAXA AW3D30, GEBCO or anywhere else, and store the results wherever you like. Runtime dependency: geopbf alone (its protobuf wire codec and compression helpers). Requires CompressionStream (all evergreen browsers); altpbf2png additionally needs OffscreenCanvas.

Loading tiles

Fetching, caching and height lookup are not part of this package. The ortho-earth engine does that in @ortho-earth/core/elevation (createGetHeight, createTileLoader), which reads tiles written in this format.

License

MIT. Technical notes: ortho-earth.com/docs/altpbf.html