0.1.2 • Published 7 years ago

geocoder-geonames v0.1.2

Weekly downloads
83
License
MIT
Repository
github
Last release
7 years ago

geocoder-geonames

A promises based node.js wrapper for the Geonames.org API.

Installation

Installing using npm:

npm i geocoder-geonames

Usage

Initialization

var GeocoderGeonames = require('geocoder-geonames'),
    geocoder = new GeocoderGeonames({
      username:      'Your Geonames.org username',
    });

The constructor function also takes an optional configuration object:

  • premium: true || false
  • endpoint: specify

Search

  geocoder.get('search',{
    q: 'Berlin'
  })
  .then(function(response){
    console.log(response);
  })
  .catch(function(error){
    console.log(error);
  });

Optional parameters:

Response

All methods return a promise.