geographer-js

0.1.5 • Public • Published

geographer-js

Build Status Code Climate

NPM

Official Geographer JavaScript package - information about all world countries and their subdivisions

Overview

TBC

Installation

$ npm install geographer-js --save

API

const Earth = require('geographer-js')

// Default entry point is our beautiful planet
const planet = Earth()

// Give me a list of all countries please
const countries = Earth().getCountries()

// Now please give me all states of Thailand
const thailand = Earth().getCountries().find(country => country.getCode() == 'TH')
const states = thailand.getStates()

// Oh, but I want them in Russian
const states = thailand.getStates().setLocale('ru')

// Oh, but I want them inflicted to 'in' form (eg. 'in Spain')
const states = thailand.getStates().setLocale('ru').inflict('in')

// What's the capital and do you have a geonames ID for that? Or maybe latitude and longitude?
const capital = thailand.getCapital()
capital.geonamesCode()
capital.getLatitude()
capital.getLongitude()

Package Sidebar

Install

npm i geographer-js

Weekly Downloads

164

Version

0.1.5

License

MIT

Unpacked Size

10.4 kB

Total Files

10

Last publish

Collaborators

  • dusterio