Registry / serialization / addresser

addresser

JSON →
library1.1.20jsnpmunverified

Street address parser for Node.js with normalization and secondary unit detection. Current stable version 1.1.20 (last released 2023). Parses US addresses into components (street number, name, suffix, direction, city, state, zip+4). Handles extra whitespace, trailing directionals, PO boxes, and secondary units without delimiters. Normalizes to Title Case and standardizes street suffixes. Includes utility functions for random city generation and city lookup. Ships TypeScript types. Limited to US addresses; no geocoding or validation against real addresses.

serializationdata
npm install addresser
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

addresser
import addresser from 'addresser'
const addresser = require('addresser')
Package exports a default object with methods: parseAddress, randomCity, cities. TypeScript types are included; use default import.
parseAddress
import addresser from 'addresser'; addresser.parseAddress(...)
import { parseAddress } from 'addresser'
parseAddress is a method on the default export, not a named export.
randomCity
import addresser from 'addresser'; addresser.randomCity()
const { randomCity } = require('addresser')
randomCity is a method on the default export. CommonJS destructuring won't work because the library uses module.exports = {...}.

Parses a US address into components, demonstrates secondary unit handling, and shows random city generation.

import addresser from 'addresser'; // Parse a full US address const result = addresser.parseAddress('400 South Orange Ave, South Orange, NJ 07079'); console.log(result.formattedAddress); // '400 South Orange Ave, South Orange, NJ 07079' console.log(result.streetNumber); // '400' console.log(result.streetName); // 'South Orange' console.log(result.streetSuffix); // 'Ave' console.log(result.placeName); // 'South Orange' console.log(result.stateAbbreviation);// 'NJ' console.log(result.zipCode); // '07079' // Handle secondary units const unitResult = addresser.parseAddress('1301 Columbia College Drive Unit 101 Columbia, SC 29203'); console.log(unitResult.addressLine2); // 'Unit 101' // Get a random city const city = addresser.randomCity(); console.log(city.city); // e.g., 'Irwin' console.log(city.state); // e.g., 'ID'
Debug
Known issues
gotchaPackage only supports US addresses. Non-US addresses will produce undefined or incorrect fields.
fix
Ensure input addresses are US-based, or use a library like node-postal for international support.
affects: >=0.0.0
gotchaparseAddress does not validate whether the address actually exists; it only parses the string into components.
fix
Use a geocoding service (e.g., Google Maps API) to verify address existence if needed.
affects: >=0.0.0
gotchaOutput formatting (Title Case, standardized suffixes) is hardcoded; no options to preserve original casing or abbreviations.
fix
Accept normalized output as-is; there is no configuration to modify this behavior.
affects: >=1.0.0
gotchaZip+4 handling: zipCodePlusFour field appears only when the input includes a +4 extension (e.g., '29526-1234'). It is not always present.
fix
Check for zipCodePlusFour property existence before using it; do not assume it is always present.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'addresser'
Package not installed or is installed in a different location.
fix
Run 'npm install addresser' in your project root, or ensure it is listed in package.json dependencies.
addresser.parseAddress is not a function
Importing incorrectly: using named import instead of default import.
fix
Use 'import addresser from 'addresser'' or 'const addresser = require('addresser')' in CommonJS.
TypeError: addresser.randomCity is not a function
Destructuring randomCity from the module incorrectly (e.g., const { randomCity } = require('addresser')).
fix
Import the whole module and call addresser.randomCity(): 'const addresser = require('addresser'); addresser.randomCity()'.
Upgrade
Version history
1.1.20latest on PyPI
Audit
Dependencies

No dependency data recorded yet.

Agent activity
54 hits · last 30 days
node
14
ahrefsbot
2
amazonbot
1
Resources