1.0.7 • Published 4 years ago

usps-webtools v1.0.7

Weekly downloads
1,263
License
MIT
Repository
github
Last release
4 years ago

Installation:

npm install usps-webtools

Usage:

Initializing the usps model with usps server url address, and user id.

Example:

const USPS = require('usps-webtools');

const usps = new USPS({
  server: 'http://production.shippingapis.com/ShippingAPI.dll',
  userId: 'USPS User id',
  ttl: 10000 //TTL in milliseconds for request
});

verify(object, callback)

Verify takes two parameters: object and callback.

object: street1, street2, city, state, zip

callback: err, address

Example

usps.verify({
  street1: '322 3rd st.',
  street2: 'Apt 2',
  city: 'San Francisco',
  state: 'CA',
  zip: '94103'
}, function(err, address) {
  console.log(address);
});

zipCodeLookup(object, callback)

zipCodeLookup takes two parameters: object and callback.

object: street1, street2, city, state

callback: err, address

Example

usps.zipCodeLookup({
  street1: '322 3rd st.',
  street2: 'Apt 2',
  city: 'San Francisco',
  state: 'CA'
}, function(err, address) {
  console.log(address);
});

cityStateLookup(object, callback)

cityStateLookup takes two parameters: zipcode and callback.

zipcode: 5 digit zipcode

callback: err, address

Example

usps.cityStateLookup('94107', function(err, result) {
  // result == { city: , state: , zip: }
});
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.3

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

9 years ago

0.2.1

9 years ago

0.2.2

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.13

9 years ago

0.0.11

10 years ago

0.0.10

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago