Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@sroussey/parse-address

sroussey2.5kISC3.0.0-beta1TypeScript support: included

US Street Address Parser

extract, address, parser, address, street, US, Canada, Geo::StreetAddress::US, geo

readme

US Street Address Parser Build Status

This is a Typescript port for the Perl Geo::StreetAddress::US package

Description from 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 and state names... more

Usage:

import addressParser from '@sroussey/parse-address'

const address = '1005 N Gravenstein Highway Sebastopol CA 95472'
const parsed = addressParser.parseLocation(address)

// Parsed address:
{
 number: '1005',
 prefix: 'N',
 street: 'Gravenstein',
 type: 'Hwy',
 city: 'Sebastopol',
 state: 'CA',
 postal_code: '95472',
}

changelog

Change Log

3.0.0

Breaking changes

  • zip is now postal_code

New features

  • Added support for Canadian addresses