city-suggest
v0.1.7
Published
Simple city search for geonames.org data dumps
Downloads
17
Readme
CitySuggest 🌇
Simple city search for geonames.org data dumps
Notes
At the time of writing, only the country codes for the United States and Canada are supported. Data used in this lib is provided via the Creative Commons Attribution 3.0 License by geonames.org
Basic Usage
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}}, ...];
Installation
yarn install
Future
- [ ] Standardize build scripts
- [ ] Support more country codes
- [ ] Ingest from multiple sources
- [ ] Faster tests
- [ ] Code-coverage