zipcodes-perogi
A zipcode lookup package with the latest zipcode information updated every month.
Last updated 9 months ago by perogi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install zipcodes-perogi 
SYNC missed versions from official npm registry.

#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

Current Tags

  • 1.4.201908                                ...           latest (9 months ago)

34 Versions

  • 1.4.201908                                ...           9 months ago
  • 1.4.201907                                ...           a year ago
  • 1.4.201906                                ...           a year ago
  • 1.4.201905                                ...           a year ago
  • 1.3.201904                                ...           a year ago
  • 1.3.201903                                ...           a year ago
  • 1.3.201902                                ...           a year ago
  • 1.3.201901                                ...           a year ago
  • 1.3.201812                                ...           a year ago
  • 1.3.201811                                ...           2 years ago
  • 1.3.201810                                ...           2 years ago
  • 1.3.201808                                ...           2 years ago
  • 1.3.201807                                ...           2 years ago
  • 1.3.201805                                ...           2 years ago
  • 1.3.201804                                ...           2 years ago
  • 1.3.201803                                ...           2 years ago
  • 1.3.201802                                ...           2 years ago
  • 1.3.201801                                ...           2 years ago
  • 1.3.201712                                ...           2 years ago
  • 1.3.201711                                ...           3 years ago
  • 1.3.201710                                ...           3 years ago
  • 1.2.201710                                ...           3 years ago
  • 1.3.201709                                ...           3 years ago
  • 1.2.201709                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.6                                ...           3 years ago
  • 1.1.5                                ...           3 years ago
  • 1.1.4                                ...           3 years ago
  • 1.1.3                                ...           3 years ago
  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 34
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |