Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
nearby-sort
Advanced tools
This is very small and lightweight library that is capable to sort the given array by provided location coordinates.
Install nearby-sort with npm
npm install nearby-sort // npm
yarn add nearby-sort // yarn
import nearbySort from 'nearby-sort'; // ES6
const nearbySort = require("nearby-sort"); // CommonJS
// User's location
const coordinates = {
lat: 31.442907,
long: 74.271519,
};
// Array need to be sorted
const arr = [
{
name: 'Kudos',
lat: 31.460443680085763,
long: 74.26974289747655,
},
{
name: 'Dr Hospital',
lat: 31.480616187193373,
long: 74.28008468009904,
},
{
name: 'Steak Studio',
lat: 31.446620698317826,
long: 74.2704643576623,
},
];
// Asc Sort
let ascSortedData = await nearbySort(coordinates, arr);
// Desc Sort
let descSortedData = await nearbySort(coordinates, arr, false);
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
nearby-sort © Yousuf
Authored and maintained by Yousuf Kalim.
GitHub @yousufkalim · LinkedIn @yousufkalim
FAQs
The library to sort array of objects by distance from a given point
The npm package nearby-sort receives a total of 0 weekly downloads. As such, nearby-sort popularity was classified as not popular.
We found that nearby-sort demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.