Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reversegeocode-to-zip

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reversegeocode-to-zip

Uses Google's geocoding API to convert longitude and latitude to a zipcode.

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

reversegeocode-to-zip

npm version

Uses Google's geocoding API to convert longitude and latitude to a zipcode. Requires supplying a google maps API key.

Installation

yarn add reversegeocode-to-zip

or

npm i reversegeocode-to-zip

Example

import reverseGeocode from "reversegeocode-to-zip"

const region = {
      latitude: 36.98823868538418,
      longitude: -122.00553903356194,
};

const GOOGLE_API_KEY = "123123";

reverseGeocode(region, GOOGLE_API_KEY)
  .then(zipcode => console.log(zipcode))
  .catch(err => console.log(err));

Note: don't actually put your API key in your code. Import it as an environment variable.

Testing

Clone repo:

git clone https://github.com/osamaq/reversegeocode-to-zip.git && cd reversegeocode-to-zip

Install dependencies (jest):

yarn

or

npm i

Run tests:

yarn test

or

npm test

Todo

  1. Write tests.

Keywords

FAQs

Package last updated on 19 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc