
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
randomcoords
Advanced tools
The Node.js client for the RandomCoords API to fetch random geographic coordinates worldwide.
The Node.js client for the RandomCoords API to fetch random geographic coordinates worldwide.
npm install randomcoords
Or
yarn add randomcoords
import RandomCoords from 'randomcoords';
Or CommonJS
const { default: RandomCoords } = require('randomcoords');
import RandomCoords from 'randomcoords';
const client = new RandomCoords({ apiToken: 'your-api-token' });
const coords = await client.getCountryCoordinates('united-states', { limit: 10 });
console.log(coords);
getRegions()None
Metadata and a list of supported regions.
getCountries()None
Metadata and a list of supported countries.
getRegionCoordinates(region, options)region (string) – The region identifier (e.g., "world", "europe").options (object, optional):
limit (number, optional) – Maximum number of coordinates to return (default: 1, maximum: 100).Metadata and random coordinates within the specified region.
getCountryCoordinates(country, options)country (string) – The country identifier (e.g., "united-states", "australia").options (object, optional):
limit (number, optional) – Maximum number of coordinates to return (default: 1, maximum: 100).Metadata and random coordinates within the specified country.
The library throws:
TypeError or Error – for validation or unexpected usage issues (e.g., invalid inputs).RandomCoordsApiError – for HTTP/API-related failures. This custom error includes:
statusCode: HTTP status code (e.g., 401, 404, 429).url: The API request URL.message: A descriptive error message.Example:
import { RandomCoordsApiError } from 'randomcoords';
try {
// a method call
} catch (err) {
if (err instanceof TypeError) {
console.error(`Invalid input: ${err.message}`);
} else if (err instanceof RandomCoordsApiError) {
console.error(`API error ${err.statusCode} at ${err.url}: ${err.message}`);
} else {
console.error('Unexpected error:', err);
}
}
If you encounter a bug, please open an issue.
MIT © Talha Awan
FAQs
The Node.js client for the RandomCoords API to fetch random geographic coordinates worldwide.
We found that randomcoords demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.