Package Exports
- geo-streetaddress-us
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (geo-streetaddress-us) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
geo-streetaddress-us
This is a NodeJS wrapper for Perl extension Geo::StreetAddress::US.
Geo::StreetAddress::US is a regex-based street address and street intersection parser for the United States. Its basic goal is to be as forgiving as possible when parsing user-provided address strings.
Geo::StreetAddress::US knows about directional prefixes and suffixes, fractional building numbers, building units, grid-based addresses (such as those used in parts of Utah), 5 and 9 digit ZIP codes, and all of the official USPS abbreviations for street types, state names and secondary unit designators.
Dependencies
- Node.js v6
- Perl 5
Usage
Install GeoStreetAddressUS from npm
npm install --save geo-streetaddress-usUse in NodeJS:
var geoStreetAddressUS = require('geo-streetaddress-us')
geoStreetAddressUS.parseLocation('1005 Gravenstein Hwy N, Sebastopol CA 95272')
/*
{
suffix: 'N',
number: '1005',
city: 'Sebastopol',
street: 'Gravenstein',
state: 'CA',
zip: '95272',
type: 'Hwy'
}
*/
geoStreetAddressUS.parseAddress('1005 Gravenstein Hwy N, Sebastopol CA 95272')
/*
{
suffix: 'N',
number: '1005',
city: 'Sebastopol',
street: 'Gravenstein',
state: 'CA',
zip: '95272',
type: 'Hwy'
}
*/
geoStreetAddressUS.parseInformalAddress('1025 Gravenstein hwy north Sebastopol CA 95272-3092')
/*
{
suffix: 'N',
number: '1025',
city: 'Sebastopol',
street: 'Gravenstein',
state: 'CA',
zip: '95272',
type: 'Hwy'
}
*/