Promises based node.js wrapper for the geonames.org geocoder.
JavaScript Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example Initial commit. Mar 29, 2016
lib Update geocoder-geonames.js Aug 8, 2017
test
.gitignore
Makefile
README.md
index.js
package.json Bump version Aug 8, 2017

README.md

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.