1.0.2 • Published 4 years ago

geocode-to-pincode v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

geocode-to-pincode

A small package to extract out pincode for any location using geocodes (latitudes and longitudes)

Installation

npm i geocode-to-pincode

Usage

const geocodeToPincode = require("geocode-to-pincode");

geocodeToPincode({lat: 28.591, lng: 77.319, key: 'you-google-maps-api-key'})
  .then(response => console.log(response.pincode)) // prints '201301'
  .catch(error => console.log(error)) // prints error object as is

// supply key either in options or as an environment variable as shown below
// GOOGLE_MAPS_API_KEY=your-actual-google-apis-key

// if for some reason pincode doesn't exist for that location
// then it prints 'NotFound' without error, this case will mostly
// not be there if the location is valid, meaning, location has a
// pincode associated with it

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.