thezipcodes

1.0.4 • Public • Published

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);
  });

Package Sidebar

Install

npm i thezipcodes

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

4.58 kB

Total Files

5

Last publish

Collaborators

  • thezipcodes