npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

us-address-parser

v1.0.4

Published

Parse US addresses into street, city, state, and zip components. Handles messy real-world formats including apartments, suites, buildings, multi-word cities, and partial addresses.

Readme

us-address-parser

Parse US address strings into street, city, state, and zip components.

Handles messy real-world formats: apartments, suites, buildings, lots, multi-word city names, partial addresses, mixed case, and more.

Installation

npm install us-address-parser

Usage

CommonJS

const { parseAddress } = require('us-address-parser');

ESM

import { parseAddress } from 'us-address-parser';

TypeScript

import { parseAddress, ParsedAddress } from 'us-address-parser';

Examples

parseAddress('14620 W Encanto Blvd STE 110 Goodyear AZ 85395')
// → { street: '14620 W Encanto Blvd STE 110', city: 'Goodyear', state: 'AZ', zip: '85395' }

parseAddress('1316 W University Dr, Mesa, AZ 85201, USA')
// → { street: '1316 W University Dr', city: 'Mesa', state: 'AZ', zip: '85201' }

parseAddress('14510 W Shumway Dr STE 100 Sun City West AZ 85375')
// → { street: '14510 W Shumway Dr STE 100', city: 'Sun City West', state: 'AZ', zip: '85375' }

parseAddress('1033 N PARKSIDE DR D413 TEMPE, AZ 85288')
// → { street: '1033 N PARKSIDE DR D413', city: 'TEMPE', state: 'AZ', zip: '85288' }

parseAddress('5740 N 59TH AVE APT 1137 BLDG 15 GLENDALE, AZ 85301')
// → { street: '5740 N 59TH AVE APT 1137 BLDG 15', city: 'GLENDALE', state: 'AZ', zip: '85301' }

parseAddress('77 E. Columbus Ave')
// → { street: '77 E. Columbus Ave', city: '', state: '', zip: '' }

parseAddress('Phoenix, AZ 85012')
// → { street: '', city: 'Phoenix', state: 'AZ', zip: '85012' }

What it handles

| Format | Example | |--------|---------| | Standard comma-separated | 123 Main St, Springfield, IL 62701 | | No commas | 123 Main St Springfield IL 62701 | | With USA or United States suffix | 123 Main St, Mesa, AZ 85201, USA | | Apartments / units | 163 E Glenn St APT 1102 Tucson AZ 85705 | | Suites | 926 E McDowell Rd STE 100 Phoenix AZ 85006 | | Buildings | 5740 N 59th Ave BLDG 15 APT 1137 Glendale AZ 85301 | | Lot numbers | 8301 N 103rd Ave LOT 73 Peoria AZ 85345 | | Trailers | 1775 N Broad St Trailer 72 Globe AZ 85501 | | Alphanumeric units | 1033 N Parkside Dr D413 Tempe AZ 85288 | | Multi-word cities | 36453 N Gantzel Rd San Tan Valley AZ 85140 | | Facility names | 14502 W Meeker Blvd Banner Del Webb ER Sun City West AZ 85375 | | Mixed / ALL CAPS | 7012 N 56TH AVE GLENDALE, AZ 85301 | | Street-only (partial) | 77 E. Columbus Ave | | City/state/zip-only (partial) | Phoenix, AZ 85012 |

Return value

{
  street: string;  // Street address + unit info
  city: string;    // City name
  state: string;   // 2-letter state abbreviation
  zip: string;     // 5-digit ZIP code
}

All fields return an empty string "" if not found.

Adding cities

The parser uses a built-in list of common US cities. If you need to support additional or less common cities, you can extend the parser for your use case — the KNOWN_CITIES array in index.js is the place to add them.

License

MIT