Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@turf/line-distance
Advanced tools
Takes a GeoJSON and measures its length in the specified units, Point's distance are ignored.
Parameters
geojson
(FeatureCollection | Feature | Geometry) GeoJSON to measureunits
[string] can be degrees, radians, miles, or kilometers (optional, default kilometers
)Examples
var line = turf.lineString([[115, -32], [131, -22], [143, -25], [150, -34]]);
var length = turf.lineDistance(line, 'miles');
//addToMap
var addToMap = [line];
line.properties.distance = length;
Returns number length of GeoJSON
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Install this module individually:
$ npm install @turf/line-distance
Or install the Turf module that includes it as a function:
$ npm install @turf/turf
FAQs
turf line-distance module
The npm package @turf/line-distance receives a total of 2,406 weekly downloads. As such, @turf/line-distance popularity was classified as popular.
We found that @turf/line-distance demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.