Skip to content

Extract street, city, state, zip, and country components from single-line address string

License

Notifications You must be signed in to change notification settings

DelightfulStudio/parse-address-string

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FOSSA Status

Extracts street, city, state, zip, and country components from single-line address string

Major changes:

  • Remove process.nextTick dependency/replace callbacks with regular returns (React Native compatibility)
  • normalize function; normalizes state and country, if any, to use the abbreviated form (CA, US, etc.)

Example

var parseAddress = require('parse-address-string')

const addressObj = parseAddress('4296 W 7th St, Long Beach, CA 90802')
console.log('Street: ', addressObj.street_address1)
console.log('City: ', addressObj.city)
console.log('State: ', addressObj.state)
console.log('Zip: ', addressObj.postal_code)
console.log('Country: ', addressObj.country)

License

FOSSA Status

About

Extract street, city, state, zip, and country components from single-line address string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%