Gathering detailed insights and metrics for us-zips
Gathering detailed insights and metrics for us-zips
Gathering detailed insights and metrics for us-zips
Gathering detailed insights and metrics for us-zips
npm install us-zips
Typescript
Module System
Min. Node Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
22 Stars
92 Commits
3 Forks
2 Watchers
4 Branches
1 Contributors
Updated on May 28, 2025
Latest Version
2022.9.1
Package Id
us-zips@2022.9.1
Unpacked Size
5.72 MB
Size
1.23 MB
File Count
30
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
A list of US ZIP codes and their geolocations
A list of United States ZIP Codes based on the US Census Bureau's ZIP Code Tabulation Areas (ZCTAs).
:information_desk_person: Before using ZIP codes, there's helpful points to know:
:package: This package:
uses ZIP Code Tabulation Areas (ZCTAs) : Some ZIP codes used by the USPS are not included, such as those with no or very few residential addresses.
uses the center of the ZCTA polygon : This keeps the package smaller, more performant, and simpler to use. ZIP codes aren't very good for geolocation anyway, so we chose to keep the amount of data loaded in memory to a minimum.
stays up-to-date with the Census Bureau's data : After new data is published, this package is updated soon. Unlike several other ZIP lists, this one purges outdated information.
Example: get the nearest ZIP to a geolocation
:information_source: If you need the nearest ZIPs for a geolocation, check out
geo2zip
. It is much faster than the demo below and uses this package.
1const geolib = require("geolib"); 2const usZips = require("us-zips/array"); 3 4const somewhere = { 5 lat: 33.1234, 6 lng: -88.4321, 7}; 8 9geolib.findNearest(somewhere, usZips); 10//» { latitude: 33.088581, longitude: -88.556133, zipCode: "39341" }
The default export returns an object. The object's keys are each ZIP code and values are objects with latitude and longitude properties.
1const usZips = require('us-zips') 2 3console.log(usZips['54301']) 4//» { latitude: 44.480778, longitude: -88.016063 } 5 6// Shape 7{ 8 … 9 '54301': { latitude: 44.480778, longitude: -88.016063 } 10 … 11}
1const usZips = require('us-zips/array') 2 3console.log(usZips.find(zip => zip.zipCode === '37214')) 4//» { latitude: 36.162189, longitude: -86.670867, zipCode: '37214' } 5 6// Shape 7[ 8 … 9 { 10 latitude: 36.162189, 11 longitude: -86.670867, 12 zipCode: '37214' 13 }, 14 … 15]
1const usZips = require('us-zips/key-value') 2 3console.log(usZips.find(([key, value]) => key === '10001')) 4//» ['10001', { latitude: 40.750634, longitude: -73.997176 }] 5 6// Shape 7[ 8 … 9 ['10001', { latitude: 40.750634, longitude: -73.997176 }], 10 … 11]
1const usZips = require("us-zips/map"); 2 3console.log(usZips.get("90210")); 4//» { latitude: 34.100517, longitude: -118.41463 }
With Yarn or npm installed, run:
1yarn add us-zips@2022.09 2 3# ...or, if using `npm` 4npm install us-zips@2022.09
:information_source: NOTE: Due to ZIP codes always changing, this package uses calendar versioning (aka CalVer). This means each year will have a separate "major" version from npm and Yarn's perspective. However, breaking changes could occur on minor versions. We suggest pinning to the minor version you want to use (e.g. yarn add us-zips@2022.09
).
Data for ZIP codes and their geolocations was generated from this file, which can be downloaded from the US Census Bureau map data page.
blakek/geo2zip
- get the nearest zip code from a geolocationblakek/standardize-geolocation
- takes geolocations of different
formats and outputs a standardized versionMIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More