{"id":15951,"library":"addressit","title":"Addressit Freeform Street Address Parser","description":"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.","status":"active","version":"1.8.2","language":"javascript","source_language":"en","source_url":"https://github.com/DamonOehlman/addressit","tags":["javascript","parser","street","address","geo"],"install":[{"cmd":"npm install addressit","lang":"bash","label":"npm"},{"cmd":"yarn add addressit","lang":"bash","label":"yarn"},{"cmd":"pnpm add addressit","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The library primarily uses CommonJS `require()`. For ESM environments, `import addressit from 'addressit'` might work with bundlers or specific Node.js configurations, but it is not officially demonstrated.","wrong":"import { addressit } from 'addressit';","symbol":"addressit","correct":"const addressit = require('addressit');"}],"quickstart":{"code":"const addressit = require('addressit');\n\n// Parse a made-up address string\nconst address = addressit('Shop 8, 431 St Kilda Rd Melbourne');\n\n// Log the parsed address object\nconsole.log(address);\n\n/* Expected output:\n{\n  text: '8/431 ST KILDA RD MELBOURNE',\n  parts: [],\n  unit: 8,\n  country: undefined,\n  number: 431,\n  street: 'ST KILDA RD',\n  regions: [ 'MELBOURNE' ]\n}\n*/","lang":"javascript","description":"Demonstrates parsing a street address string and logging the structured output."},"warnings":[{"fix":"Ensure that Node.js v16 or a newer version is used for both development and production environments when working with `addressit` v1.8.1 or later.","message":"Running `addressit` versions 1.8.1 and later on Node.js environments older than v16 may encounter issues due to the updated `package-lock.json` format introduced in these versions.","severity":"gotcha","affected_versions":">=1.8.1"},{"fix":"Implement custom logic or integrate with external geographical data services to further process the `regions` array if detailed city, state, or country identification is required.","message":"The library's core functionality is focused on parsing street names, numbers, and unit information. Broader geographical components (such as city, state, or country) are not individually identified but are instead aggregated into a generic `regions` array, which requires additional application-specific parsing.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Run `npm install addressit` or `yarn add addressit` in your project directory to install the dependency.","cause":"The `addressit` package has not been installed or is not accessible in the current project's `node_modules`.","error":"Error: Cannot find module 'addressit'"},{"fix":"Ensure you are using `const addressit = require('addressit');` for CommonJS or `import addressit from 'addressit';` for ESM setups.","cause":"This error typically occurs if the module is imported incorrectly (e.g., `require('addressit').addressit`) when the module itself exports the function directly as its default.","error":"TypeError: addressit is not a function"},{"fix":"Always pass a valid string as the first argument to the `addressit()` function, ensuring it's not null or undefined.","cause":"This error occurs if the `addressit()` function is called without a string input, or with a `null` or `undefined` value, leading to attempts to call string methods on a non-string.","error":"TypeError: Cannot read properties of undefined (reading 'split')"}],"ecosystem":"npm"}