
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
ng-haversine
Advanced tools
ng-haversine is an AngularJS module that applies the Haversine formula to a pair of coordinates to calculate the distance between them.
ng-haversine is an AngularJS module that applies the Haversine formula to a pair of coordinates to calculate the distance between them.
The first step is to download the ng-haversine script. You can do it cloning this repo:
$ git clone https://github.com/vermicida/ng-haversine.git
Or via NPM:
$ npm install ng-haversine
Once the library is downloaded, make sure you are referencing it in your index.html
, just after the AngularJS library reference:
<script src="./node_modules/ng-haversine/ng-haversine.min.js"></script>
You must inject the ng-haversine dependency within your module setter:
angular.module("test", ["dahr.ng-haversine"]);
Now, you are ready to go. You will need two coordinates given in the format below:
var coord1 = {
"latitude": 40.4169473,
"longitude": -3.7057172
};
var coord2 = {
"latitude": 40.4236942,
"longitude": -3.7109793
};
To calculate the distance between them, you must use the function distance()
from the service $haversine
:
var distance = $haversine.distance(coord1, coord2);
IMPORTANT: The distance is given in meters.
Code released under the MIT license.
FAQs
ng-haversine is an AngularJS module that applies the Haversine formula to a pair of coordinates to calculate the distance between them.
The npm package ng-haversine receives a total of 0 weekly downloads. As such, ng-haversine popularity was classified as not popular.
We found that ng-haversine 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.