Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

geodistance-super

puujee2ISC1.0.1

given locations bewteen distance

geodistance, lat, lon, km., m

readme

geodistance

Package setup

yarn add geodistance-super

or

npm i geodistance-super

Quick setup

main.js

var calculate = require('geodistance-super')
let lat1 = 47.91844, lng1 = 106.88467, lat2 = 47.90068, lng2 = 106.87918;
let unit = 'km'
calculate(lat1, lng1, lat2, lng2, unit).then(data=>{
    console.log(data)
})

Result:

{
    string: '2.016769830436128 km',
    number: 2.016769830436128
}