turf

The complete, modular geospatial analysis engine for JavaScript and TypeScript, bundling every Turf.js module under one install.

Library
npm
v7.4.0
10,472stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity96
Maintenance72
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
88/100Excellent
Architecture85
Code Quality90
Innovation75
Learning Curve100

@turf/turf is the umbrella package for the Turf.js project, bundling all of its individually-published @turf/* modules into a single install so JavaScript and TypeScript developers get measurement, transformation, and statistics tooling for GeoJSON data without managing dozens of scoped dependencies by hand.

Built as a pnpm monorepo of small, single-purpose packages that are each independently tested and versioned, @turf/turf re-exports every function under one flat namespace while remaining tree-shakeable for bundlers that only need a handful of operations, and it also ships a prebuilt, minified browser bundle for direct script-tag use with no build step.

What You Get

  • A full GeoJSON toolkit covering measurement (distance, area, bearing), transformation (buffer, simplify, union), and boolean spatial predicates (contains, intersects, within) in one package.
  • A tree-shakeable ESM build (sideEffects: false) so bundlers only ship the functions your code actually imports.
  • TypeScript types built directly against the GeoJSON spec’s own type definitions, with strict, composite project-reference builds across all sub-packages.
  • A prebuilt, minified browser bundle (turf.min.js) for drop-in <script> usage with no build tooling required.
  • Auto-generated, example-driven API docs pulled straight from JSDoc comments in each module, published at turfjs.org.

Common Use Cases

  • Computing distances, bearings, and areas for GeoJSON features in a mapping application.
  • Running boolean spatial queries (point-in-polygon, intersects, contains) to filter map data.
  • Generating buffers, grids, and Voronoi/TIN meshes as part of a spatial analysis pipeline.
  • Clustering point data (k-means, DBSCAN) and classifying it with statistical methods (Jenks, quantile).
  • Server-side geospatial processing in Node.js APIs without native GIS dependencies such as GDAL or GEOS bindings.

Under The Hood

Architecture Turf is organized as a pnpm workspace of roughly 115 small, single-purpose packages (turf-along, turf-buffer, turf-boolean-contains, and so on), each with its own package.json, tests, and fixtures; @turf/turf (packages/turf) is a thin re-export barrel — its index.ts imports the named function from every sibling package and re-exports it under one flat namespace, then bundles and minifies the result with esbuild into turf.min.js for browser use. Because most modules compose lower-level siblings internally (turf-along calls into turf-bearing, turf-destination, and turf-distance, for example), a change to a foundational package like turf-invariant or turf-helpers ripples through nearly every consumer, which the monorepo’s TypeScript project references and composite builds are designed to catch at compile time.

Tech Stack Each package is authored in strict TypeScript (target es2022, module node18) and built with tsc —build in composite/project-reference mode so cross-package type errors surface immediately; the browser bundle is produced with esbuild, targeting a Browserslist-driven set of modern browsers. The workspace is managed with pnpm and a shared dependency catalog (catalog: version pinning for TypeScript, tape, tsx, and @types packages), with monorepolint enforcing consistent package.json shape across all ~115 packages, husky/lint-staged running ESLint (flat config) and Prettier on commit, and GitHub Actions running the full build/doc/test cycle across a Node 22/24/26 matrix.

Code Quality Every sub-package carries its own test.ts (using the tape assertion library) alongside GeoJSON fixture files, so behavior is checked at the individual-function level rather than only through the umbrella package; @turf/turf’s own test.ts additionally cross-checks that JSDoc, exports, and dependency declarations stay consistent across all modules. CI regenerates the API docs from JSDoc comments and fails the build if the regenerated output differs from what’s committed (git diff —exit-code), which keeps documentation from drifting out of sync with the code. Strict TypeScript, ESLint, Prettier, and a Node-version test matrix round out a well-enforced quality bar for a project with this many independently-versioned packages.

API Design @turf/turf’s main value is consolidation: instead of installing and importing dozens of individual @turf/* packages, consumers get every operation under one flat, consistently-named namespace (along, booleanPointInPolygon, clustersKmeans, isobands, and so on) with a uniform (feature, …args, options) call signature and an options object for shared concerns like units. Functions are documented with runnable @example blocks that double as the source for the published API docs, and because the package declares sideEffects: false, bundlers can still tree-shake down to only the functions actually used despite the single-package import style — a low-boilerplate way to get comprehensive GeoJSON tooling without sacrificing bundle size.

Used by 15 apps in this directory

Java
78%
GPL 3.0

DataEase

Analytics · Data Engineering · AI Assistants

24,408

Open-source BI tool with drag-and-drop dashboards, 20+ data source connectors, and AI-powered natural language queries — a self-hosted alternative to Tableau.

View details
93
Repo Health
71
Technical
65
Dependency
Built with
Java78%
Vue22%
Updated 3 days ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,442

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
61
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 4 weeks ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search