Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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 54,524 weekly downloads. As such, nearby-sort popularity was classified as 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.