# What changed in geolib

> 23 changes in geolib 4 from its official release notes, upgrade guides and advisories: 12 breaking, 3 new APIs and options. Each one cited. Sources checked 2026-10-25. HTML: https://unstale.sh/npm/geolib/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## geolib 4

### Breaking changes

- The browser build no longer supports AMD loaders. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- 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.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The default area unit is now square meters. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The browser build moved from `lib/index.js` to this file. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The output targets ES2020, so very old browsers such as Internet Explorer are no longer supported. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- There is no default export; use `import * as geolib from 'geolib'` instead. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- Deep imports are gone; import named functions from the package root instead. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- Deep imports are gone; import named functions from the package root instead. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The result is rounded to the given accuracy, 1 meter by default; pass an accuracy of 0 for the unrounded distance. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- 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.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The type definitions require TypeScript 4.7 or newer. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- Validators return false instead of throwing when given null. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)

### New APIs and options

- Adds a function for finding the intersection of lines. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- Adds a function for checking whether a point is in a bounding box. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- TypeScript types are now exported from the package entry. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)

### Performance

- Each distance is now calculated only once. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)

### Behavior and default changes

- The type of the points is preserved in the result. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The type of the points is preserved in the result. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)

### Fixes and other changes

- The function now uses the haversine formula as documented. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- Point-in-line checks are now precise for long and short lines. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The comparison now uses the unrounded distance. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- The comparison now uses the unrounded distance. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
- WKT polygons are parsed regardless of whitespace and parentheses. (4.0.0) — [release notes](https://github.com/manuelbieh/geolib/releases/tag/v4.0.0)
