Gathering detailed insights and metrics for @turf/turf
Gathering detailed insights and metrics for @turf/turf
Gathering detailed insights and metrics for @turf/turf
Gathering detailed insights and metrics for @turf/turf
A modular geospatial engine written in JavaScript and TypeScript
npm install @turf/turf
Typescript
Module System
Node Version
NPM Version
71.6
Supply Chain
78.9
Quality
87.5
Maintenance
100
Vulnerability
97
License
TypeScript (86.84%)
JavaScript (13.15%)
Shell (0.01%)
Total Downloads
62,778,365
Last Day
41,639
Last Week
663,585
Last Month
3,070,540
Last Year
24,511,684
9,454 Stars
3,691 Commits
944 Forks
182 Watching
46 Branches
165 Contributors
Minified
Minified + Gzipped
Latest Version
7.1.0
Package Id
@turf/turf@7.1.0
Unpacked Size
585.18 kB
Size
143.88 kB
File Count
10
NPM Version
lerna/8.1.7/node@v18.20.4+x64 (linux)
Node Version
18.20.4
Publised On
09 Aug 2024
Cumulative downloads
Total Downloads
Last day
-74.3%
41,639
Compared to previous day
Last week
-4.3%
663,585
Compared to previous week
Last month
3.6%
3,070,540
Compared to previous month
Last year
58.5%
24,511,684
Compared to previous year
114
A modular geospatial engine written in JavaScript
Turf is a JavaScript library for spatial analysis. It includes traditional spatial operations, helper functions for creating GeoJSON data, and data classification and statistics tools. Turf can be added to your website as a client-side plugin, or you can run Turf server-side with Node.js (see below).
1# get all of turf 2npm install @turf/turf 3 4# or get individual packages 5npm install @turf/helpers 6npm install @turf/buffer
Download the minified file, and include it in a script tag. This will expose a global variable named turf
.
1<script src="turf.min.js" charset="utf-8"></script>
You can also include it directly from a CDN:
1<script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script>
Turf modules ship with type definitions packaged in each module. No DefinitelyTyped packages required.
The types defined in the GeoJSON specification are maintained separately (Geometry, Polygon, etc). To refer to these in your own code, install @types/geojson
and import from there:
1import { type Polygon } from "geojson";
Ports of Turf.js are available in:
Turf for Swift is experimental and its public API is subject to change. Please use with care.
The Turf for Dart port is still in progress, the implementation status can be found in the README.
Turf uses GeoJSON for all geographic data. Turf expects the data to be standard WGS84 longitude, latitude coordinates. Check out geojson.io for a tool to easily create this data.
NOTE: Turf expects data in (longitude, latitude) order per the GeoJSON standard.
Most Turf functions work with GeoJSON features. These are pieces of data that represent a collection of properties (ie: population, elevation, zipcode, etc.) along with a geometry. GeoJSON has several geometry types such as:
Turf provides a few geometry functions of its own. These are nothing more than simple (and optional) wrappers that output plain old GeoJSON. For example, these two methods of creating a point are functionally equivalent:
1// Note order: longitude, latitude. 2var point1 = turf.point([-73.988214, 40.749128]); 3 4var point2 = { 5 type: 'Feature', 6 geometry: { 7 type: 'Point', 8 // Note order: longitude, latitude. 9 coordinates: [-73.988214, 40.749128] 10 }, 11 properties: {} 12};
Turf packages are compiled to target ES2017. However, the browser version of @turf/turf is transpiled to also include support for IE11. If you are using these packages and need to target IE11, please transpile the following packages as part of your build:
@turf/*
robust-predicates
rbush
tinyqueue
This project exists thanks to all the people who contribute. If you are interested in helping, check out the Contributing Guide.
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
No vulnerabilities found.
Reason
19 commit(s) and 17 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
project is fuzzed
Details
Reason
Found 26/29 approved changesets -- score normalized to 8
Reason
6 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More