// the find
uber/h3-js
h3-js provides a JavaScript version of H3, a hexagon-based geospatial indexing system.
h3-js is the JavaScript port of Uber's H3 hexagonal grid system, compiled from C via Emscripten. It lets you map any lat/lng to a hexagon at one of 16 resolutions, then do spatial operations — neighbors, rings, polygon fill, compaction — entirely client-side or in Node. The target audience is anyone building geospatial features who wants a discrete, hierarchical grid instead of raw coordinates.
The API is clean and well-named — `latLngToCell`, `cellToChildren`, `gridDisk` do exactly what they say. Full parity with the C library means you're not getting a stripped-down subset; everything in the C API is here. The hierarchical resolution system (coarse parent → fine children) is genuinely useful for multi-zoom aggregation without re-querying. TypeScript definitions are included and kept in sync via a build script rather than maintained by hand.
The Emscripten-compiled `libh3.js` bundle is heavy — this isn't a lightweight dependency, and the bundle size will surprise anyone who hasn't read the README carefully before shipping it to a browser. JavaScript's lack of 64-bit integers forces the awkward `SplitLong` workaround for H3 index representation; the library hides it reasonably well but it's still a leaky abstraction you'll hit eventually. The `gridPathCells` and `cellToLocalIj` functions have documented failure modes around pentagons that return errors rather than graceful fallbacks, which means production code needs explicit error handling for edge cases most developers won't anticipate in testing. No native WebAssembly SIMD optimization — the C core does no vectorized math, so bulk operations on millions of cells are slower than they could be.