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

us-zips

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

us-zips

A list of US ZIP codes and their geolocations

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.6K
increased by7.14%
Maintainers
1
Weekly downloads
 
Created
Source

us-zips

A list of US ZIP codes and their geolocations

I needed a list of ZIP codes, and the US Census Bureau had one.

Usage

Example: get the nearest zip to a geolocation

const geolib = require('geolib')
const usZips = require('us-zips')
const somewhere = {
  lat: 33.1234,
  lng: -88.4321
}

geolib.findNearest(somewhere, usZips)  // { distance: 12834, key: '39341' }

If you want to get the nearest ZIP, just use blakek/geo2zip.

Data Format

Returns an object with keys for each ZIP code. The value of each key is an object with lat and lng properties.

const usZips = {
  '12345': {
    lat: 12.345678,
    lng: -87.654321
  },
  ...
}

Install

With npm installed, run

$ npm install --save us-zips

Acknowledgments

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

See Also

License

MIT

FAQs

Package last updated on 01 Dec 2016

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