Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 976 Bytes

README.md

File metadata and controls

38 lines (28 loc) · 976 Bytes

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