Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

humanize-distance

1.0.9 • Public • Published

humanize-distance

Calculates a humanized distance between 2 Points (longitude, latitude)

Example outputs: < 50m, 450m, 750yd, 0.9 mi, 2,8 km

bitHound Overall Score npm Package travis-ci.org js-standard-style license

Usage

npm i humanize-distance --save
 
const humanizeDistance = require('humanize-distance')
 
console.log(humanizeDistance(
  {latitude: 50.95, longitude: 6.91},
  {latitude: 50.9486184, longitude: 6.9426425},
  'de-DE',
  'metric'))
// 2,8 km
 
console.log(humanizeDistance(
  {latitude: 50.9440107, longitude: 6.9419526},
  {latitude: 50.9486184, longitude: 6.9426425},
  'en-US',
  'us'))
// 550 yd
 

Twitter URL GitHub stars

install

npm i humanize-distance

Downloadsweekly downloads

10

version

1.0.9

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability