Library / SDK
Turfjs/turf avatar
Turfjs/turf

Turf JS: a bundle of every module, or the one you import

A modular geospatial engine written in JavaScript and TypeScript

10,551 stars1,027 forksTypeScriptMIT

At a glance

What is it?
Turf is a modular geospatial engine for JavaScript and TypeScript, covering spatial operations, GeoJSON creation helpers and classification and statistics. The repository and the published package disagree about granularity: one npm package contains a bundle of every module, and the pieces underneath it are yours to import individually.
Who is it for?
Adopt Turf when your work is GeoJSON in the browser or in Node.js and you want one dependency covering spatial operations, GeoJSON helpers and statistics instead of stitching three libraries together. Do not adopt it if your data arrives in a projected CRS, if you need raster or vector tile output, or if you deploy on Deno or Bun and need someone to answer for that runtime.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 5 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Turfjs/turf10,551 ★ · +59
Star history
Repository2026-09-222026-11-22
Turfjs/turf10.5k10.6k

59 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One package bundles every module, the repository keeps them apart

The modularity lives in the repository layout more than in the artifact most people install. Individual modules sit under packages/ in directories named packages/turf-*, the root package.json is marked "private": true, and pnpm-workspace.yaml with pnpm-lock.yaml hold the workspace together. What npm consumers install as @turf/turf is the combined package, which carries a browser bundle that combines, transpiles and minifies all Turf modules into a single JavaScript file.

Two shapes therefore exist inside one project. The umbrella package is one file containing everything, and the individual modules are the pieces you select when your bundler can drop what you never import. The examples directory is split along the same line, with separate directories for a browser setup, a create-react-app setup, an ES modules setup and one named es-modules-single-module.

The README carries no install line, it forwards to turfjs.org

There is no install command anywhere in this README, which is worth knowing before you scan the page for one. Getting Started sends you to the getting started guide at https://turfjs.org/docs/getting-started, and the next line points to the Turf API and examples at turfjs.org. For server-side use, the text links to the @turf/turf package page on npm.

The consequence is that the package name, the module format and your first import all come from a separate site rather than from the repository front page. Someone reading the GitHub page alone gets a one-line description, a runtime support statement and a browser support statement, and nothing about how a project acquires the library. The homepage recorded for the repository points at turfjs.org, which is the same destination the README sends you to.

Node is first class, Deno and Bun sit outside the support line

The runtime section draws a boundary and then invites people to step over it politely. Turf is published to work with any reasonably modern JavaScript runtime, Node is called a first class citizen, and an Active or Maintenance LTS release is the recommended version. Then the sentence that matters for a non-Node deployment: other runtimes, such as Deno or Bun, are not officially supported, and the project would like to hear about your experiences.

For a team shipping on Bun, that sentence is the entire risk statement. A runtime-specific failure on Bun or Deno is therefore something you report yourself, since the project says those runtimes are not officially supported. The same section shifts browser work onto you as well: when bundling Turf for the browser, the instruction is to make sure your build setup transpiles and polyfills Turf along with all of its transitive dependencies to match your target browsers.

The browser bundle is all-in, so payload size is an import decision

Since @turf/turf includes a browser bundle that combines, transpiles and minifies all Turf modules into a single JavaScript file, taking the umbrella package costs you every module in your download unless your bundler can see through it. Minified is not the same as small when the unit happens to be the entire library.

This is where the modular layout earns its keep. Importing an individual module instead of the combined package is the only lever on that number, and the examples directory keeps a directory named es-modules-single-module to show the shape. The cost lands on you instead: every module imported separately is a version you have to keep in step with the rest, and the README does not address keeping those versions aligned.

Minimum browser targets follow the Browserslist preset, not your config

Browser support gets one sentence, and it describes the maintainers rather than the consumers: minimum browser targets are updated periodically using Browserslist's default preset. Your own browserslist configuration does not set the floor for Turf. The floor moves when the preset moves, and it moves under your application instead of through a change in your build file.

That shows up later as a bug report naming your app. If the library stops emitting syntax your oldest supported browser parses, or starts depending on a built-in that browser lacks, your build can still succeed while the page fails on exactly the device you were keeping alive. The one lever the README offers is the transpile-and-polyfill instruction in the runtime section, applied to Turf and to all of its transitive dependencies, which is your own build absorbing a target you did not choose.

The scope is GeoJSON, and projections are never mentioned

Scope is stated once: traditional spatial operations, helper functions for creating GeoJSON data, and data classification and statistics tools. That is a vector, GeoJSON-shaped scope, and the GeoJSON helpers mean the library helps you assemble the objects it then analyses. Classification and statistics sit next to the geometric operations rather than behind a separate pipeline.

Coordinate reference systems, reprojection, raster data and vector tiles do not appear anywhere in the README. If your source arrives in a projected CRS, something outside Turf has to move it into the coordinate space your GeoJSON expects, and this page does not tell you which space that is or which datum it assumes. Treat the CRS question as open rather than settled, and settle it at turfjs.org before you design around it.

Client-side module or server-side Node.js, and the fork is real

The README offers one genuine choice of approach: Turf can be added to your website as a client-side module, or you can run Turf server-side with Node.js. Same library, different deployment, different bill.

Client-side puts the geometry processing in the browser, so the payload becomes your users' download and their device does the work. Server-side puts Node.js in the picture, which the runtime section calls a first class citizen with an LTS release recommended, and no geometry ever reaches the client. The browser bundle exists for the first path. The polyfill instruction exists because that path needs your build to carry the gap between modern browsers and old ones. Choose the side of the fork where the geometry already lives, because moving later means moving the data path, not just the import statement.

Contribution runs through pnpm, monorepolint and documentation lint

The root package.json is private and pins its package manager in devEngines, naming pnpm at version 11.21.0. Work happens in a pnpm workspace, husky installs on prepare, and lint-staged rewrites files before commit, including the generated readmes under packages/*/index.ts via node ./scripts/generate-readmes.mts. Checks are split by tool rather than run as one pass, with documentation lint over packages/turf-*/index.js and monorepolint through mrl check. The gate before a commit is two commands:

sh
pnpm run lint && pnpm -r run test

Ordering matters there, since lint runs first and pnpm -r then walks the workspace. The repository also keeps tsconfig.shared.json, eslint.config.mjs, .prettierrc.json, a releases/ directory and a test/ directory, which is how a monorepo looks when types, formatting, release notes and tests are all expected to move together. Turf is MIT licensed with the LICENSE file at the root, the last push to master was on 2026-10-26, the repository is not archived, and v7.4.0 was released on 2026-08-03.

Editorial conclusion

Adopt Turf when your work is GeoJSON in the browser or in Node.js and you want one dependency covering spatial operations, GeoJSON helpers and statistics instead of stitching three libraries together. Do not adopt it if your data arrives in a projected CRS, if you need raster or vector tile output, or if you deploy on Deno or Bun and need someone to answer for that runtime. Verify one thing before committing: build once with a single module import instead of @turf/turf and read the resulting payload, because the browser bundle ships every Turf module in one file and that choice is expensive to reverse later.

Frequently asked questions

How do I install Turf JS?

The README gives no install command. Its Getting Started section links to the getting started guide at https://turfjs.org/docs/getting-started, and for server-side use it links to the @turf/turf package page on npm.

Does Turf JS work in Deno or Bun?

Not officially. The README states that other runtimes, such as Deno or Bun, are not officially supported, while Node is a first class citizen and an Active or Maintenance LTS release is the one recommended.

What is the difference between the @turf/turf bundle and single modules?

@turf/turf includes a browser bundle that combines, transpiles and minifies all Turf modules into a single JavaScript file. Individual modules live under packages/ in the repository, and the examples directory keeps a setup named es-modules-single-module alongside the full ES modules example.

Does Turf JS handle map projections and rasters?

The README does not mention coordinate reference systems, reprojection, raster data or vector tiles. Its stated scope is traditional spatial operations, GeoJSON creation helpers, and data classification and statistics tools.

How do I contribute to Turf JS?

The README points contributors to docs/CONTRIBUTING.md. The root package.json is private, declares pnpm 11.21.0 as its package manager, and holds the build, lint and test scripts, with husky and lint-staged wiring the pre-commit checks.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. Turfjs/turf on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/turfjs-turf.svg)](https://hysenlabs.com/projects/turfjs-turf)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/turfjs-turf.svg)](https://hysenlabs.com/projects/turfjs-turf)

Was this useful?