Get zipcode, city and country for given coordinates or user location
$ bower install zipcoder
$ npm install zipcoder
zipcoder.coordinates(52.519444, 13.406667, function(data) {
console.log(data);
// {
// lat: 52.519444,
// lng: 13.406667,
// zipcode: '10178',
// city: 'Berlin',
// country: 'Germany',
// }
});
Uses browser geolocation to determine the current user location.
zipcoder.location(function(data) { ... });
At the moment zipcoder
just supports the GoogleMap Geocoding API. In the future this package will support other APIs as well. Feel free to contribute with a pull request.