Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

zipcode-data

wbrickner362ISC1.0.0

Lookup data regarding any US zipcode: city, state, and more

postal, code, zip, zipcode, post, state, city, daylight, savings, dst, USA

readme

ZipCodeData

Get data on any US zipcode, including the state, city, and the use of daylight savings time.

Installation

$ npm install zipcode-data

Then to use ZipCodeData:

const ZipCodeData = require('zipcode-data');

Usage

You can pass in the zipcode as an integer (number) or a string.

Zipcode to state lookup

var state = ZipCodeData.stateFromZip(60201);

Zipcode to city lookup

var city = ZipCodeData.cityFromZip(60201);

Does this zipcode use daylight savings time?

// let's find out! (this method returns a boolean)
var usesDST = ZipCodeData.dstFromZip(60201);

What if I want all this data at once?

var zipCodeData = ZipCodeData.lookupZip(60201);

Is this zipcode in the USA?

// let's find out! (this method returns a boolean)
var isUSA = ZipCodeData.isUSA(60201);

License

Do whatever you want with this. If this package saved you time, money, or effort, please consider adding somewhere Thanks to Will Brickner for ZipCodeData. I worked hard on it and gave it to you for free <3.