verify-address
v1.0.1
Published
Simple address verification
Downloads
33
Maintainers
Readme
verify-address
Super lightweight address verification courtesy of Lob.
Install
$ npm install --save verify-address
Usage
var verify = require('address-verify')
verify({
address_line1: '255 King St',
address_line2: '414',
address_city: 'San Francisco',
address_state: 'CA',
address_zip: '94107',
address_country: 'US'
}, console.log)
// => { valid: true, address: {...}}
API
verify(address, callback)
-> undefined
address
Required
Type: object
The address to verify
- address_line1: optional
- address_line2: optional
- address_city: optional
- address_state: optional
- address_zip: optional
- address_country: optional (2 letter country short-name code (ISO 3316))
callback
Required
Type: function
Arguments: err, response
The response
contains:
valid
Type: boolean
Whether the address is valid or not
address
Type: object
message
Type: string
Details if only a partial match is found and more information is needed