Addressit Freeform Street Address Parser

1.8.2 · active · verified Tue Apr 21

addressit is a JavaScript library designed to parse freeform street address text into a structured object. The current stable version is 1.8.2. Recent releases have primarily focused on maintenance and minor feature additions, indicating an irregular but active release cadence. Its primary differentiator is its specialized focus on extracting the street parsing components (unit, building number, street name, and street type). Broader geographical details like city, state, or country are collected into a generic `regions` array, requiring further application-specific processing. This design choice acknowledges the vast variability of global address formats and avoids attempting a universal, country-specific identification within the core library. It is best suited for applications where extracting the fundamental street information from unstructured text is paramount, rather than providing comprehensive geopolitical address validation.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates parsing a street address string and logging the structured output.

const addressit = require('addressit');

// Parse a made-up address string
const address = addressit('Shop 8, 431 St Kilda Rd Melbourne');

// Log the parsed address object
console.log(address);

/* Expected output:
{
  text: '8/431 ST KILDA RD MELBOURNE',
  parts: [],
  unit: 8,
  country: undefined,
  number: 431,
  street: 'ST KILDA RD',
  regions: [ 'MELBOURNE' ]
}
*/

view raw JSON →