Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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 }
FAQs
An assortment of geolocation related tools, all packaged in one easy to use kit.
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 found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.