Skip to content

Simple city search for geonames.org data dumps

License

Notifications You must be signed in to change notification settings

Hustle/city-suggest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CitySuggest 🌇

Simple city search for geonames.org data dumps

Notes

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

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
  • Code-coverage

About

Simple city search for geonames.org data dumps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published