1.4.201908 • Published 5 years ago

zipcodes-perogi v1.4.201908

Weekly downloads
118
License
MIT
Repository
github
Last release
5 years ago

#Zip Code Lookup Build Status

A localized (flatfile) zipcode lookup.

Zipcode data is taken from a new more up-to-date zipcode source compared to davglass' project. This source has monthly updates for zip code data. For example: June 2019 data added 2 zip codes.

Other Differences

This application only has the default zip code information and only for the 50 US states and Washington, DC.

Last Change Log

Version 1.3.201908 1 change from July 2019 - Removal of one zipcode npm audit: found 0 vulnerabilities Stryker mutation tests. Passed 100.0 0 Survived

Usage

var zipcodes = require('zipcodes-perogi');

Zipcode Lookup

const hills = zipcodes.lookup(90210);  
  
response:
{
  "zip": "90210",
  "city": "Beverly Hills",
  "state": "CA",
  "latitude": "34.096629",
  "longitude": "-118.412426",
  "timeZoneId": "America/Los_Angeles"
}

Zipcode LookupWithTime

const hills = zipcodes.lookupWithTime(03301);  
  
response:
{
  "zip": "03301",
  "city": "Concord",
  "state": "NH",
  "latitude": "43.23876",
  "longitude": "-71.511",
  "timeZoneId": "America/New_York",
  "time": "2019-05-03T22:15:05-04:00"
}

Lookup By Name

const l = zipcodes.lookupByName('Concord', 'NH');  
  
//Always returns an array, since cities can have multiple zip codes
response: 
[ 
    {
      "zip": "03301",
      "city": "Concord",
      "state": "NH",
      "latitude": "43.23876",
      "longitude": "-71.511",
      "timeZoneId": "America/New_York"
    },
    {
      "zip": "03302",
      "city": "Concord",
      "state": "NH",
      "latitude": "43.23387",
      "longitude": "-71.55967",
      "timeZoneId": "America/New_York"
    },
    {
      "zip": "03303",
      "city": "Concord",
      "state": "NH",
      "latitude": "43.30368",
      "longitude": "-71.6385",
      "timeZoneId": "America/New_York"
    },
    {
      "zip": "03305",
      "city": "Concord",
      "state": "NH",
      "latitude": "43.206116",
      "longitude": "-71.539058",
      "timeZoneId": "America/New_York"
    }
 ]
 

Lookup By State

const l = zipcodes.lookupByState('NH');
  
//response would be an array of cities with corresponding data
[ 
    {
      "zip": "03031",
      "city": "Amherst",
      "state": "NH",
      "latitude": "42.860306",
      "longitude": "-71.608545",
      "timeZoneId": "America/New_York"
    },
    {
      "zip": "03032",
      "city": "Auburn",
      "state": "NH",
      "latitude": "42.997422",
      "longitude": "-71.35159",
      "timeZoneId": "America/New_York"
    },
    {
      "zip": "03033",
      "city": "Brookline",
      "state": "NH",
      "latitude": "42.739053",
      "longitude": "-71.677821",
      "timeZoneId": "America/New_York"
    }
 ...
 ]

The original CSV file that I am using for this data is not included in this repo due to licensing, but I did wrap up the best way to get the data and how to convert it into the format that this module uses.

Note: This is a fork of davglass' excellent zipcode lookup project.

Historical Change Log

See CHANGE_LOG.md file

1.4.201908

5 years ago

1.4.201907

5 years ago

1.4.201906

5 years ago

1.4.201905

5 years ago

1.3.201905

5 years ago

1.3.201904

5 years ago

1.3.201903

5 years ago

1.3.201902

5 years ago

1.3.201901

5 years ago

1.3.201812

5 years ago

1.3.201811

5 years ago

1.3.201810

6 years ago

1.3.201808

6 years ago

1.3.201807

6 years ago

1.3.201805

6 years ago

1.3.201804

6 years ago

1.3.201803

6 years ago

1.3.201802

6 years ago

1.3.201801

6 years ago

1.3.201712

6 years ago

1.3.201711

7 years ago

1.3.201710

7 years ago

1.2.201710

7 years ago

1.3.201709

7 years ago

1.2.201709

7 years ago

1.2.2

7 years ago

1.2.0

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago