# geojson-flatten

> transform geojson into single-parts

Latest version **2.0.1** (published 2026-09-21) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install geojson-flatten
pnpm add geojson-flatten
yarn add geojson-flatten
bun add geojson-flatten
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-09-21 |
| First published | 2014-01-02 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 54 |
| Author | Tom MacWright |
| Maintainers | tmcw |
| Keywords | geojson, maps, flatten |

## Links

- npm: https://www.npmjs.com/package/geojson-flatten
- Repository: https://github.com/tmcw/geojson-flatten
- Issues: https://github.com/tmcw/geojson-flatten/issues
- npm.io page: https://npm.io/package/geojson-flatten

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-09-21
- 2.0.0 — 2026-09-16
- 1.1.2 — 2026-09-14
- 1.1.1 — 2022-10-24
- 1.1.0 — 2022-10-24
- 1.0.5 — 2022-10-24
- 1.0.4 — 2020-03-17
- 1.0.3 — 2020-02-06
- 1.0.2 — 2020-01-23
- 1.0.1 — 2019-01-31
- 0.2.4 — 2019-01-31
- 1.0.0 — 2019-01-29
- 0.2.3 — 2019-01-29
- 0.2.2 — 2018-02-14
- 0.2.1 — 2016-09-17
- … 3 more at https://npm.io/package/geojson-flatten/versions

## README

# geojson-flatten

Flatten MultiPoint, MultiPolygon, MultiLineString, and GeometryCollection
geometries in [GeoJSON](http://geojson.org/) files into simple non-complex
geometries.

If a FeatureCollection is passed in, a FeatureCollection is returned. If a single Feature is passed in, an array of Features is returned.

## install

```
npm install --save geojson-flatten
```

Or download `geojson-flatten.js` for non-[browserify](http://browserify.org/) usage.

## example

```js
let flatten = require('geojson-flatten');

flattened = flatten(geojsonObject);
```

---
_Source: https://npm.io/package/geojson-flatten · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
