Mysql haversine query generator.
npm install mysql-haversine
Given your coordinates it compares the circular distance from you with each coordinate in the given database table.
var mysqlHaversine = require('mysql-haversine');
var query = mysqlHaversine.query(100, 'stores', 18.370531, -66.143399, 'ASC');
query(distance, table_name, your_latitude, your_longitude, order_by)
It compares the circular distance from your coordinates with each coordinate in the given db table. It only returns the results of the ones that are less than or equal to the given distance(km) and orders them ascending(ASC) or descending(DESC).
distance = max radius to query of the circle around your coordinate(km)
table_name = name of the the database table
your_latitude = your current latitude
your_longitude your current longitude
order_by = how you want to order the results(ASC or DESC)