1.0.4 • Published 3 years ago

thezipcodes v1.0.4

Weekly downloads
6
License
ISC
Repository
-
Last release
3 years ago

TheZipCodes

this package is developed to use www.thezipcodes.com apis.

Installation

Use the package manager npm to install foobar.

npm i thezipcodes --save

Usage

Initialization
const theZipCodes = require("thezipcodes");
const theZipCodesApi = new theZipCodes("apiKey");
Get Zip Code Location
theZipCodesApi
  .getZipCodeLocation(
    "13040", // zipCode
    "US" // countryCode
  )
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });
Get States
theZipCodesApi
  .getStates("US") // countryCode
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });
Get distance between zip codes
theZipCodesApi
  .getDistance(
    "13040", // fromZipCode
    "13041", // toZipCode
    "US" //  countryCode
  )
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });