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

hyperleaflet

v0.5.1

Published

Leaflet for HTML

Readme

hyperleaflet

Leaflet maps driven entirely by HTML attributes. No JavaScript required.

https://user-images.githubusercontent.com/50503448/217046480-e997b33b-fddc-4c6d-af5e-18a6f4899928.mp4

Show a map

<div id="map" style="height:100vh" data-center="[39.73, 39.99]" data-zoom="5">
  <div data-tile="OpenStreetMap" data-default-tile></div>
</div>

<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://www.unpkg.com/hyperleaflet"></script>

Add markers

Any element with data-id inside a data-hyperleaflet-source container becomes a marker on the map:

<table data-hyperleaflet-source>
  <tr data-id="1" data-geometry="[39.97, 32.85]" data-geometry-type="Point">
    <td>Ankara</td>
  </tr>
  <tr data-id="2" data-geometry="[41.01, 28.98]" data-geometry-type="Point">
    <td>Istanbul</td>
  </tr>
</table>

Your data is your markup. A <table>, a list of <div>s, anything — hyperleaflet doesn't care about the element type, just the data-* attributes.

Style them

<span data-id="quake"
      data-geometry-type="CircleMarker"
      data-geometry="[38.5, 37.0]"
      data-color="#ef4444"
      data-radius="10"
      data-fill-opacity="0.6"
      data-popup="<b>M5.2</b> Earthquake">
</span>

It's reactive

Add, remove, or change elements in the DOM and the map updates automatically. This makes it work with HTMX, Turbo, or anything that swaps HTML:

<div data-hyperleaflet-source
     hx-get="/markers"
     hx-trigger="map:move from:window delay:300ms"
     hx-swap="innerHTML">
</div>

Pan the map, HTMX fetches new markers, hyperleaflet puts them on the map. No glue code.

Features

  • Geometry types -- Point, CircleMarker, LineString, Polygon
  • Inline styles -- data-color, data-radius, data-fill-opacity, data-weight, data-dash-array, etc.
  • Popups & tooltips -- data-popup, data-tooltip
  • Layer groups -- data-layer-name for togglable overlays
  • JS API -- hyperleaflet.flyTo(), hyperleaflet.openPopup(id), hyperleaflet.getLayer(id), hyperleaflet.getBBoxString()
  • Events -- hyperleaflet:ready, map:click, map:move, map:zoom, geometry:click
  • SPA support -- auto-initializes when #map appears in the DOM
  • 5 KB gzipped

Demo

Earthquake Explorer -- 81,000 earthquakes from USGS, filterable by time, magnitude, and map bounds. Built with FastAPI, HTMX, and hyperleaflet. (source)

Install

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css">
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://www.unpkg.com/hyperleaflet"></script>

Or via npm:

npm install hyperleaflet

Documentation

See docs/usage.md for the full reference.

Development

npm install
npm run dev     # watch mode
npm run build   # produces dist/hyperleaflet.umd.js
npm test        # unit tests (vitest)
npm run e2e     # browser tests (playwright)

License

MIT