geocoder-geonames

0.1.2 • Public • Published

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.

Package Sidebar

Install

npm i geocoder-geonames

Weekly Downloads

18

Version

0.1.2

License

MIT

Last publish

Collaborators

  • stephangeorg