Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

haversine

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haversine - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

8

haversine.js

@@ -28,3 +28,7 @@ // haversine

return R * c
if (options.threshold) {
return options.threshold > (R * c) ? true : false
} else {
return R * c
}
}

@@ -34,2 +38,2 @@

module.exports = haversine
module.exports = haversine
{
"name": "haversine",
"version": "0.0.2",
"version": "0.0.3",
"description": "A simple haversine module",

@@ -5,0 +5,0 @@ "main": "haversine.js",

@@ -15,8 +15,8 @@ # Haversine

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

@@ -26,4 +26,3 @@

console.log(haversine(start, end, {unit: 'km'}))
## Future
I plan on adding more options soon including a threshold check.
console.log(haversine(start, end, {threshold: 1}))
console.log(haversine(start, end, {threshold: 1, unit: 'km'}))
var haversine = require('../haversine');
start = {
latitude: 50.03,
longitude: 05
latitude: 30.849635,
longitude: -83.24559
}
end = {
latitude: 58.38,
longitude: 03
latitude: 27.950575,
longitude: -82.457178
}

@@ -20,2 +20,8 @@

// using objects with unit conversion
console.log(haversine(start, end, {unit: 'km'}))
console.log(haversine(start, end, {unit: 'km'}))
// utilizing the threshold option
console.log(haversine(start, end, {threshold: 1}))
// utilizing the threshold option & unit conversion
console.log(haversine(start, end, {threshold: 1, unit: 'km'}))
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc