1.0.0 • Published 8 years ago

distance.js v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

distance.js

NodeJs module to calc distances between two points using coords. Originally cloned from https://gist.github.com/1604972. Response is in km

Installation

npm install distance.js --save

Usage

var distance = require('distance.js');

var start = {
  latitude: Coords,
  longitude: Coords
}
var end = {
  latitude: Coords,
  longitude: Coords
}

var distance = distance.getDistance(start, end) // Decimals is 2 by default.
var distance = distance.getDistance(start, end, 3) // Returns 3 decimals
console.log("Distance is: " + distance)