MadisonReed / usps-webtools

USPS Web Tools API wrapper
42 stars 37 forks source link

Incorrect Example In ReadMe.md #26

Closed koder217 closed 6 years ago

koder217 commented 7 years ago

Following looks wrong in ReadMe.md: cityStateLookup appears to take zip code and yet, an address object is passed in the example.

cityStateLookup(object, callback)
cityStateLookup takes two parameters: zipcode and callback.
zipcode: 5 digit zipcode
callback: err, address
Example:
usps.cityStateLookup({
  street1: '322 3rd st.',
  street2: 'Apt 2',
  city: 'San Francisco',
  state: 'CA'
}, function(err, address) {
  console.log(address);
});

Why does zipCodeLookup take an address object? It appears the cityStateLookup description is mixed up with zipCodeLookup description.

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