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

styled-map-package

v6.2.0

Published

CLI for creating, viewing, and converting Styled Map Package (.smp) files

Readme

styled-map-package

CLI for creating, viewing, and converting Styled Map Package (.smp) files.

An .smp file is a ZIP archive containing all the resources needed to serve a MapLibre vector styled map offline: style JSON, vector and raster tiles, glyphs (fonts), sprites, and metadata.

Installation

Requires Node.js >= 22.

npm install --global styled-map-package

Commands

smp download

Download an online map style to a .smp file for offline use.

smp download https://demotiles.maplibre.org/style.json \
  --bbox '-180,-80,180,80' \
  --zoom 5 \
  --output demotiles.smp

Options:

| Option | Description | | ---------------------- | ---------------------------------------------------------------------- | | -o, --output <file> | Output file (writes to stdout if omitted) | | -b, --bbox <w,s,e,n> | Bounding box (west, south, east, north) | | -z, --zoom <number> | Max zoom level (0-22) | | -t, --token <token> | Mapbox access token (required for Mapbox styles) | | -d, --dedupe | Deduplicate tiles with identical content to reduce file size | | --skip-local-glyphs | Skip CJK/Hangul/Kana glyph ranges rendered locally by MapLibre GL | | --all-glyph-ranges | Download every glyph range, not only those used by downloaded labels | | --buffer-tiles | Download an extra tile ring around the bbox at each zoom below maxzoom |

When run interactively, missing options are prompted for.

The --buffer-tiles flag downloads one extra tile ring around the bbox at every zoom level below maxzoom, so the map is not clipped at the edges of the downloaded area when zooming out. The buffer is not added at maxzoom. smp view automatically renders these buffer tiles.

smp view

Preview a .smp file in a web browser.

smp view demotiles.smp --open

Options:

| Option | Description | | --------------------- | -------------------------------------------------------------------------- | | -o, --open | Open in the default web browser | | -p, --port <number> | Port to serve on (default: 3000) | | --no-fallback | Return 404 for missing tiles and glyphs instead of serving empty fallbacks |

By default the viewer serves empty tiles and Noto Sans glyphs for any resource not present in the file, so incomplete packages (those covering a partial area or zoom range) preview without 404 errors. Missing vector tiles are served as empty MVTs, missing raster tiles as transparent pixels. Missing glyph ranges are served using bundled Noto Sans glyphs (via GoNotoKurrent, covering 80+ scripts including Latin, Cyrillic, Greek, Arabic, Hebrew, Devanagari, Thai, and more). CJK and Hangul ranges are not bundled since MapLibre renders these client-side via localIdeographFontFamily. Pass --no-fallback to return 404s instead.

For packages downloaded with buffer tiles (recorded as smp:bufferTiles in the style metadata), the viewer also widens each source's bounds so the lower-zoom buffer tiles that extend beyond the data area are rendered rather than clipped. Combined with the empty-tile fallback, panning beyond the downloaded area shows blank tiles instead of console errors.

smp mbtiles

Convert an MBTiles file to a .smp file.

smp mbtiles tiles.mbtiles --output map.smp

Options:

| Option | Description | | --------------------- | ------------------------------------------------ | | -o, --output <file> | Output .smp file (writes to stdout if omitted) |

smp validate

Validate a .smp file against the SMP specification.

smp validate map.smp

Reports errors (spec MUST violations) and warnings (SHOULD/RECOMMENDED), each annotated with a severity level:

  • fatal — the file cannot be opened by the reader
  • rendering — the map opens but content will be visibly broken (missing tiles, glyphs, sprites)
  • spec — non-compliance that doesn't affect practical use

Glyph coverage is checked by reading the vector tiles and requiring every glyph range their labels use. Pass --no-glyph-coverage to skip reading tiles and only require range 0-255.

Exits with code 0 if valid, 1 if errors are found.

License

MIT