JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 369
  • Score
    100M100P100Q90321F
  • License MIT

Translates latitude / longitude geolocations to the nearest corresponding U.S. zip code

Package Exports

  • geo2zip

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (geo2zip) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

geo2zip

Translates latitude / longitude geolocations to the nearest corresponding U.S. zip code

Takes a geolocation and returns the nearest US ZIP code

Usage

Let's do X:

const geo2zip = require('geo2zip')

const somewhere = {
  latitude: 34.659698,
  longitude: -88.242903
}

geo2zip(somewhere).then(zip => {
  console.log(zip) // '38873'
})

Install

With npm installed, run

$ npm install geo2zip

Acknowledgments

Data for ZIP codes and their geolocations was generated from this file, which can be downloaded from the US Census Bureau site.

License

MIT