unstale

npm / geolib

geolib

What changed in geolib 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.

12 breaking3 new APIs and options1 performance2 behavior and defaults5 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.6 on npm

geolib 423 changes

Breaking changes 12

  • The browser build no longer supports AMD loaders.

    4.0.0release notes

  • The default radius is now 6,378,137 meters, moving results by about 0.1%; pass 6371000 as the fourth argument for previous results.

    4.0.0release notes

  • The default area unit is now square meters.

    4.0.0release notes

  • The browser build moved from lib/index.js to this file.

    4.0.0release notes

  • The output targets ES2020, so very old browsers such as Internet Explorer are no longer supported.

    4.0.0release notes

  • There is no default export; use import * as geolib from 'geolib' instead.

    4.0.0release notes

  • Deep imports are gone; import named functions from the package root instead.

    4.0.0release notes

  • Deep imports are gone; import named functions from the package root instead.

    4.0.0release notes

  • The result is rounded to the given accuracy, 1 meter by default; pass an accuracy of 0 for the unrounded distance.

    4.0.0release notes

  • Polygon edges spanning more than 180 but less than 360 degrees of longitude are treated as crossing the antimeridian; add an intermediate vertex when an edge should go the long way around.

    4.0.0release notes

  • The type definitions require TypeScript 4.7 or newer.

    4.0.0release notes

  • Validators return false instead of throwing when given null.

    4.0.0release notes

New APIs and options 3

  • Adds a function for finding the intersection of lines.

    4.0.0release notes

  • Adds a function for checking whether a point is in a bounding box.

    4.0.0release notes

  • TypeScript types are now exported from the package entry.

    4.0.0release notes

Performance 1

Behavior and default changes 2

  • The type of the points is preserved in the result.

    4.0.0release notes

  • The type of the points is preserved in the result.

    4.0.0release notes

Fixes and other changes 5

  • The function now uses the haversine formula as documented.

    4.0.0release notes

  • Point-in-line checks are now precise for long and short lines.

    4.0.0release notes

  • The comparison now uses the unrounded distance.

    4.0.0release notes

  • The comparison now uses the unrounded distance.

    4.0.0release notes

  • WKT polygons are parsed regardless of whitespace and parentheses.

    4.0.0release notes