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.
An assortment of geolocation related tools, all packaged in one easy to use kit.
An assortment of geolocation related tools, all packaged in one easy to use kit.
Geokit.distance(start: LatLngLiteral, end: LatLngLiteral, unit?: string): number
Static method which returns the distance, in kilometers, between start
and end
.
start
and end
must be LatLngLiterals { lat: 0, lng: 0 }
.
There exists an optional third argument, where if the string 'miles'
is inputted, the result returned will be in miles rather than kilometers.
import { Geokit, LatLngLiteral } from 'geokit';
const start: LatLngLiteral = { lat: 40.7128, lng: -74.0060 };
const end: LatLngLiteral = { lat: 37.7749, lng: -122.4194 };
const distance: number = Geokit.distance(location1, location2, 'miles'); // distance === 2568.4458439997047
Geokit.hash(coordinates: LatLngLiteral, precision?: number): string
Static method which generates the geohash of a point.
coordinates
must be LatLngLiterals { lat: 0, lng: 0 }
.
There exists an optional second argument of precision, where the hash produced will be as many characters as the number inputted. It defaults to 10.
import { Geokit, LatLngLiteral } from 'geokit';
const coordinates: LatLngLiteral = { lat: 41.3083, lng: -72.9279 };
const hash: string = Geokit.hash(coordinates); // hash === 'drk4urzw2c'
Geokit.decodeHash(hash: string): LatLngLiteral
Static method which decodes geohash into its Latitude and Longitude as a LatLngLiteral.
import { Geokit, LatLngLiteral } from 'geokit';
const hash: string = 'r3gx2f77b';
const coordinates: LatLngLiteral = Geokit.decodeHash(hash); // coordinates === { lat: -33.86881113052368, lng: 151.2093186378479 }
0.1.4 (2019-06-17)
FAQs
An assortment of geolocation related tools, all packaged in one easy to use kit.
The npm package geokit receives a total of 2,924 weekly downloads. As such, geokit popularity was classified as popular.
We found that geokit 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.