geocoder-geonames
v0.1.2
Published
Promises based node.js wrapper for geonames.org
Downloads
108
Maintainers
Readme
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:
- you can pass all request parameters
Response
All methods return a promise.