Skip to content

MenaraSolutions/geographer-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

Official Geographer JavaScript package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published