nearby-cities
Give me your coordinates and I'll tell you where the nearest cities are. Works offline.
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install nearby-cities --save
Usage
const nearbyCities = const query = latitude: 344362755 longitude: -119705086const cities = assertassertassertassertassert console /*{ name: "Mission Canyon", country: "US", featureClass: "P", featureCode: "PPL", adminCode: "CA", population: 2381, lat: 34.45083, lon: -119.71291}*/
Tests
npm installnpm test
Dependencies
- all-the-cities: All the 138,398 cities of the world with a population of at least 1000 inhabitants, in a big JSON array
- kdbush: a spatial index for 2D points
- geokdbush: a geographic extension for kdbush
Dev Dependencies
- mocha: simple, flexible, fun test framework
- standard-format: attempts to reformat javascript to comply with feross/standard style
License
MIT
Generated by package-json-to-readme