
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.
@aashari/nodejs-geocoding
Advanced tools
A lightweight TypeScript/Node.js library for geocoding and reverse geocoding operations with multilingual support
A lightweight TypeScript/Node.js library for geocoding and reverse geocoding operations with multilingual support. This library provides a simple, dependency-free solution for converting between addresses and geographic coordinates.
⚠️ Disclaimer: This library is intended for non-commercial, low-volume applications. For production or commercial use, please use the official Google Maps API.
npm install @aashari/nodejs-geocoding
const geocoding = require('@aashari/nodejs-geocoding');
// Convert address to coordinates
geocoding
.encode('Empire State Building, New York')
.then((locations) => console.log(locations))
.catch((error) => console.error(error));
const geocoding = require('@aashari/nodejs-geocoding');
// Convert coordinates to address
geocoding
.decode(40.7484, -73.9857)
.then((location) => console.log(location))
.catch((error) => console.error(error));
Converts an address string to geographic coordinates.
function encode(
formattedAddress: string,
language?: string = 'en',
): Promise<Location[]>;
Returns: Array of location objects with coordinates and formatted address.
Converts geographic coordinates to an address.
function decode(
latitude: number,
longitude: number,
language?: string = 'en',
): Promise<Location | null>;
Returns: Location object with formatted address and Google Plus Code, or null if not found.
interface Location {
latitude?: number;
longitude?: number;
google_plus_code?: string;
formatted_address?: string;
}
Specify a language code as the last parameter to get results in different languages:
// Get results in French
geocoding
.encode('Tour Eiffel, Paris', 'fr')
.then((locations) => console.log(locations));
// Get results in Japanese
geocoding
.decode(35.6895, 139.6917, 'ja')
.then((location) => console.log(location));
Supports all language codes that Google Maps supports (e.g., en, fr, de, ja, zh-CN, es, etc.)
[
{
formatted_address:
'Empire State Building, 20 W 34th St, New York, NY 10001, United States',
latitude: 40.7484405,
longitude: -73.9856644,
},
];
{
latitude: 40.7484,
longitude: -73.9857,
formatted_address: 'Empire State Building, 20 W 34th St, New York, NY 10001, United States',
google_plus_code: '87G8Q2M4+96'
}
import { encode, decode, Location } from '@aashari/nodejs-geocoding';
async function getLocationData(): Promise<void> {
try {
// Forward geocoding
const locations: Location[] = await encode('Tokyo Tower, Japan');
// Reverse geocoding
if (locations.length > 0) {
const { latitude, longitude } = locations[0];
const address: Location | null = await decode(latitude, longitude);
console.log(address);
}
} catch (error) {
console.error('Error:', error);
}
}
async function getLocationInfo() {
try {
// Geocoding
const coordinates = await geocoding.encode('Colosseum, Rome');
console.log('Coordinates:', coordinates);
// Reverse Geocoding using the first result
if (coordinates && coordinates.length > 0) {
const { latitude, longitude } = coordinates[0];
const address = await geocoding.decode(latitude, longitude);
console.log('Address:', address);
}
} catch (error) {
console.error('Error:', error);
}
}
async function safeGeocode(address) {
try {
const results = await geocoding.encode(address);
if (!results || results.length === 0) {
console.log(`No results found for address: ${address}`);
return null;
}
return results;
} catch (error) {
console.error(`Error geocoding address "${address}":`, error);
return null;
}
}
This project is licensed under the MIT License.
Made with ❤️ by aashari
FAQs
A lightweight TypeScript/Node.js library for geocoding and reverse geocoding operations with multilingual support
We found that @aashari/nodejs-geocoding 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
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.