git404hub

what is turf fr?

turfjs/turf — explained in plain English

Analysis updated 2026-06-24

10,365TypeScriptAudience · developerComplexity · 2/5Setup · easy

tl;dr

A modular JavaScript library that brings GIS mapping analysis, distance, area, intersection, clustering, directly into browser or Node.js apps using standard GeoJSON data.

vibe map

mindmap
  root((Turf.js))
    What it does
      Distance calculation
      Area measurement
      Point in polygon
      Shape combining
    Data format
      GeoJSON points
      GeoJSON polygons
      GeoJSON collections
    Where it runs
      Browser module
      Node.js backend
    Works with
      Leaflet
      Mapbox
      Any GeoJSON tool

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Check whether a delivery address falls inside a specific service area polygon on a map.

VIBE 2

Calculate the distance between two user-placed map markers and display it in kilometers.

VIBE 3

Measure the area of user-drawn regions on an interactive Leaflet or Mapbox map.

VIBE 4

Cluster geographic data points server-side in a Node.js backend before sending them to a map.

what's the stack?

TypeScriptJavaScriptNode.jsnpmGeoJSON

how it stacks up fr

turfjs/turfvanilla-extract-css/vanilla-extractbia-pain-bache/bpb-worker-panel
Stars10,36510,37010,358
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min

in plain english

Turf is a JavaScript library for working with geographic data. It provides functions for spatial analysis: things like calculating the distance between two locations, finding whether a point falls inside a polygon, measuring areas, combining shapes, and running statistical calculations on geographic datasets. These are the kinds of operations you normally associate with dedicated mapping software or GIS (Geographic Information System) tools, but Turf makes them available directly in JavaScript code. The library works with a data format called GeoJSON, which is a standard way of representing geographic features (points, lines, polygons, collections of these) as JSON text. Most web mapping tools already speak GeoJSON, so Turf slots naturally into projects that use libraries like Leaflet or Mapbox to display maps. Turf can run in two places. In a browser, you include it as a JavaScript module on the page. On a server, you install it through npm (the Node.js package manager) and run it as part of a backend application. The library is modular, meaning you can install just the specific functions you need rather than pulling in the entire package, which keeps your project's file size down. The project is open source, funded through Open Collective where individuals and companies can become backers or sponsors. It is actively maintained and accepts contributions through GitHub. Official documentation and interactive examples are available at turfjs.org. Browser support targets any reasonably modern browser, and Node.js is treated as a first-class runtime environment.

prompts (copy fr)

prompt 1
Using Turf.js, write JavaScript code that takes a user's GeoJSON point location and an array of GeoJSON service-area polygons, and returns the name of the area the user is currently inside.
prompt 2
I'm building a Leaflet map app. Use @turf/distance to calculate the distance in kilometers between two markers the user has placed, and display the result in a popup.
prompt 3
Write a Node.js script using @turf/turf that reads a GeoJSON file of city boundary polygons and logs the area of each city in square kilometers.

Frequently asked questions

what is turf fr?

A modular JavaScript library that brings GIS mapping analysis, distance, area, intersection, clustering, directly into browser or Node.js apps using standard GeoJSON data.

What language is turf written in?

Mainly TypeScript. The stack also includes TypeScript, JavaScript, Node.js.

How hard is turf to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is turf for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.