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

@nkarasiak/m3s

v0.6.0

Published

Ergonomic JS/WASM wrapper over the shared m3s Rust core (parity with the Python API).

Readme

m3s — JavaScript / WASM

An ergonomic JS API over the shared m3s Rust core. The grid classes mirror the Python facade (m3s.H3, m3s.Geohash, …) in camelCase and produce identical results — JS and Python consume the same m3s-core crate.

This is a thin layer: it wraps the generated WASM functions into classes and computed getters and never reimplements grid math.

Install

npm install @nkarasiak/m3s

The package ships both a Node (CommonJS WASM) and a browser (ESM WASM) build; the right one is selected automatically through the exports map.

Use

import * as m3s from "@nkarasiak/m3s";
await m3s.ready();                                   // awaits WASM init (no-op on Node)

const cell = m3s.H3.fromPoint(-74.0060, 40.7128, 7); // (lon, lat, precision)
console.log(cell.id, cell.areaKm2);

const cells = m3s.Geohash.fromBbox([-74.02, 40.70, -73.93, 40.80], 6);
console.log(cells.length, cells.toIds());

await m3s.ready() is required on the web (it awaits WASM init) and harmless on Node, so the same line works everywhere.

Build from source

cd bindings/js
wasm-pack build --target nodejs --out-dir pkg      # Node build  (used by index.node.js)
wasm-pack build --target web    --out-dir pkg-web  # Web build   (used by index.web.js)

API at a glance

  • Grids: A5 Geohash H3 MGRS S2 Quadkey Slippy CSquares GARS Maidenhead PlusCode EAQuad RHEALPix
  • Grid methods: fromPoint(lon, lat, p?) · fromBbox([minLon,minLat,maxLon,maxLat], p?) · fromId(id) · fromIds([...]) · fromGeometry(geom, p?) · neighbors(cellOrId, depth=1, includeSelf=true) · children/parent (hierarchical grids only) · withPrecision(p) · getters name defaultPrecision precisionRange hierarchical. A5 also: cellAreaM2(p).
  • Cell: id precision ring ringOpen areaKm2 centroid bounds toGeoJSON()
  • CellCollection: iterable · length at slice toIds ids toPolygons toGeoJSON filter map unique neighbors(depth) refine(p) coarsen(p) totalAreaKm2 bounds
  • Top-level: ready() precisionBounds(name?) geodesicAreaKm2(ring) Cell CellCollection Grid

Coordinate order

The wrapper boundary is GIS-native (lon, lat), matching the Python API, Shapely and GeoJSON. Cell ring/centroid/bounds are [lon, lat] too.

What's Python-only

The core supports point→cell and bbox→cells. These stay Python-only and are deliberately absent here:

  • true polygon fill (fromGeometry reduces a polygon to its bounding box)
  • precision strategies (find_precision, find_precision_for_area/use_case)
  • GeoPandas / pandas export (to_gdf, to_dataframe), save, plot/explore
  • dissolve, cross-grid conversion (to_h3, to_geohash, …)
  • the h3-py verb vocabulary, GridBuilder, MultiGridComparator, PrecisionSelector