buddyeorl / zipcode-city-distance-pkg

Simple package for all US Zip Codes and Cities, get the distance between Zip Codes or Cities, get relevant information such as coordinates, cities within Zip Codes, Zip Codes covered by cities, states etc, get all the Zip Codes within certain radius and more.
MIT License
7 stars 2 forks source link

Missing some zipcodes #1

Open argordmel opened 3 years ago

argordmel commented 3 years ago

Hello, this tool is amazing!

It's possible to add manually or extend your zipcode database?

For example, the zip code 11249 is not in the database but is postal code valid.

buddyeorl commented 3 years ago

Hi there, glad you like this tool.

To feed this tool, I'm using the official census data zipcode files here, but it's possible to add zipcodes manually, you can send me your PR with the changes on allZipCodesFilesWithCityNamesShort.js and shortCityData.js or I can try to update the files and package this weekend and see if we can pull new zipcode data that was not pulled on the last data update.

ngscripts commented 1 year ago

It's throwing error on this zip:

const zipCodeData = require('zipcode-city-distance');
let zipInfo = zipCodeData.getInfo('zipcode', '22556');

console.log(zipInfo);

Throwing this error: /node_modules/zipcode-city-distance/helper/getInfo.js:18 if ((type === 'city' || type === 'zipcode') && (zipCodes[query] || cities[city])) { ^

ReferenceError: city is not defined at Object.module.exports.getInfo (/Users/anwaar/WebstormProjects/test-js/node_modules/zipcode-city-distance/helper/getInfo.js:18:79) at Object. (/Users/anwaar/WebstormProjects/test-js/zipcode.js:9:27) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47