Simple city search for geonames.org data dumps
At the time of writing, only the following country codes are supported:
- US — 🇺🇸
- CA — 🇨🇦
Data used in this lib is provided via the Creative Commons Attribution 3.0 License by geonames.org
NOTE: City name dependencies are lazy-loaded, so you should initialize instances as early as you can.
const CitySuggest = require('city-suggest');
const opts = {
countryCodes: ['us'],
resultsLimit: 5
};
const citysuggest = new CitySuggest(opts);
const suggestions = citysuggest.suggest('San'); // [{ name: 'San Francisco, CA, USA', latitude: 123, longitude: 456}}, ...];
yarn install
- Standardize build scripts
- Support more country codes
- Ingest from multiple sources
- Code-coverage