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

@mapprism/mapprism-2d

v1.1.2

Published

Vanilla TypeScript library wrapping MapLibre GL JS for 2D maps in the MapPRISM platform. User-facing docs live in [`docs-site/`](docs-site/).

Readme

mapprism-2d

Vanilla TypeScript library wrapping MapLibre GL JS for 2D maps in the MapPRISM platform. User-facing docs live in docs-site/.

Library (this package)

npm install
npm run build    # same as npm run build:lib
npm run lint

Outputs under dist/: ESM, CJS, index.d.ts, and mapprism-2d.css. Consumers need maplibre-gl installed (peer dependency).

CDN alternative (R2 public bucket):

  • Base URL: https://pub-78d8b203e7a5426d953b50368fb4be3f.r2.dev/cdn/mapprism-2d/latest/dist
  • ESM: .../index.esm.js
  • CSS: .../mapprism-2d.css

For browser-only integration details (including MapLibre shim/import map), see docs-site/guide/getting-started.md.

Measurement API highlights:

  • map.tools.measurement.startLine() / startArea() to begin drawing.
  • Press Enter to finalize and keep drawing more measurements.
  • map.tools.measurement.startDelete() to remove a drawing by clicking it.
  • map2d.tools.measurement.controls (default true) toggles built-in top-right tool buttons.
  • Labels auto-scale units: distance (m/ft -> km/mi) and area (m2/ft2 -> km2/mi2) using metric thresholds.

Potree sync highlight:

  • Optional runtime sync can be enabled by passing map2d.sync with a live Potree viewer reference:
const map = new MapPrism2D(container, {
  map2d: {
    // ... normal map2d config ...
    sync: {
      enabled: true,
      master: "auto", // "auto" | "map2d" | "potree"
      mapPriorityMs: 1200,
      potree: {
        viewer: window.viewer,
        throttleMs: 50,
      },
    },
  },
})

viewer is runtime-only (in-memory object reference), not a field expected in backend JSON.

Potree + 2D demo (demo/)

The live dual-panel viewer (Potree 3D + MapPrism 2D) lives in demo/index.html. MapLibre and the built library are copied into demo/vendor/ so the demo folder is self-contained for hosting.

npm install
npm run dev:site   # syncs vendor assets, then serves repo root — open /demo/index.html
  • npm run build:demo — runs scripts/sync-demo-vendor.mjs: builds the library if dist/ is missing, then copies MapLibre + dist/ into demo/vendor/. Generated files are gitignored.
  • npm run deploy:demobuild:demo then uploads demo/ to Cloudflare Pages project mapprism-2d (requires wrangler login).

Public docs + demo deployment (Cloudflare)

This repository deploys through Cloudflare Pages.

  • Build command: npm run build:cloudflare
  • Build output directory: cloudflare-dist
  • Root directory: repository root (blank/default)

The Cloudflare build output serves:

  • docs at /
  • demo at /demo/index.html

If your Pages project still uses npm run build:demo with output demo, the demo is served at / (not under /demo/). Update the project to npm run build:cloudflare and output cloudflare-dist so docs and /demo/index.html match this README. Until then, demo/_redirects redirects /demo/index.html/index.html so the hero “Open Demo” link does not 404.

Library release delivery

Release automation now supports both npm and Cloudflare R2 artifact delivery:

  • CI checks: .github/workflows/ci.yml (lint + build on PR/main)
  • Release pipeline: .github/workflows/release.yml (main push -> semantic-release -> npm + R2 when releasable commits exist)

Required repo configuration is documented in docs/DELIVERY.md (secrets, variables, and object paths).

Legacy React demo

The original React + react-map-gl proof-of-concept lives in _react-archive/ as a separate package:

cd _react-archive && npm install && npm run dev

Docs