Projects
View on GitHub
SonoJS/SonoJS-geo
About
A lightweight JavaScript and TypeScript package providing country, state, and city data with simple APIs.
Web & App DevelopmentMeasured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original@sonojs/geo
Countries, states, and cities for JavaScript. Lazy-loaded shards, async API, TypeScript types.
Links
Install
npm install @sonojs/geo
Usage
import { getCountryByIso2, getCitiesByCountry } from "@sonojs/geo";
const country = await getCountryByIso2("JP");
const cities = await getCitiesByCountry("JP");
Browser or custom hosting:
import { configureGeo, getCountryByIso2 } from "@sonojs/geo";
configureGeo({
dataBaseUrl: new URL("./node_modules/@sonojs/geo/data/", import.meta.url).href,
});
await getCountryByIso2("JP");
License
Package code: MIT (LICENSE). Geographic data: ODbL 1.0 (NOTICE.md, ODbL-1.0.txt) from dr5hn/countries-states-cities-database.
Explore related projects
Loading…