A simple haversine module

npm install haversine
15 downloads in the last day
101 downloads in the last week
428 downloads in the last month


A simple haversine formula module for Node.js

I created this small module for an application I created and figured I would package it up to share.


$ npm install haversine


haversine(start, end, options)

var haversine = require('haversine')

start = {
  latitude: 30.849635,
  longitude: -83.24559
end = {
  latitude: 27.950575,
  longitude: -82.457178

console.log(haversine(start, end))
console.log(haversine(start, end, {unit: 'km'}))
console.log(haversine(start, end, {threshold: 1}))
console.log(haversine(start, end, {threshold: 1, unit: 'km'}))
npm loves you