Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Utility library for calculating the nearest set of things to a target thing, geospatially speaking
Nearest.js is a small utility library for calculating the nearest set of things to a target thing, geospatially speaking. In JavaScript.
For example, a list of restaurant reviews near to where you work,
Include in your page,
<script src="nearest.js"></script>
... and the Nearest.find
function will return the items in that list sorted approximately in order of the distance from a given coordinate.
results = new Nearest().find(dataSource, {
coords: [51.5349, -0.1219],
limit: 10,
within: 3
})
The parameters in full,
dataSource
- a data structure as per the format outline below.coords
- the lat/lon pair of the central location you want the search to start from.limit
- limit the number of results returned.within
- limit results to within n kilometers.Nearest.js requires a datasource containing a list of objects, each containing a lat and lon property.
[
{
"path": "lifeandstyle/2012/jan/08/jay-rayner-restaurant-review-create",
"restaurant": "Create",
"reviewer": "John Lanchester",
"lat": "53.797331",
"lon": "-1.549829"
},
{
"path": "lifeandstyle/2012/jan/06/granger-and-co-restaurant-review",
"reviewer": "John Lanchester",
"lat": "51.514502",
"lon": "-0.198357",
"links": [
"foo": "http://example.com/foo",
"bar": "http://example.com/bar"
]
}
...
]
FAQs
Utility library for calculating the nearest set of things to a target thing, geospatially speaking
The npm package nearestjs receives a total of 0 weekly downloads. As such, nearestjs popularity was classified as not popular.
We found that nearestjs 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.