The `australia-address-parser` package offers a dedicated, regex-based utility for programmatically parsing Australian street addresses and street intersections from unstructured user-provided strings. Its core functionality involves dissecting an address into constituent parts such as street number, name, type, suburb, state, and postcode. A key differentiator is its ability to explicitly identify and return the street type (e.g., Road, Street, Avenue), a detail often generalized or omitted by more comprehensive mapping services like Google APIs. The package is currently at version 1.0.1, although its README indicates it is still under active development, suggesting that its API might evolve, and new features or refinements to its parsing logic could be introduced with a potentially frequent release cadence. It's suitable for applications requiring structured address data extraction, data validation, or enhancing geo-coding efforts by providing more granular address components for Australian locations.
npm install australia-address-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to parse various Australian address formats (standard, intersection, with unit) using the `parseLocation` method.
Monitor the GitHub repository for updates and test thoroughly after package upgrades. Consider locking to a specific patch version if stability is critical.
Validate parsing results against a diverse set of real-world addresses. Consider pre-processing addresses to normalize common patterns if parsing failures are observed.
Create a `declarations.d.ts` file with `declare module 'australia-address-parser';` or a more specific definition for `parseLocation` to provide basic type safety.
If working in a pure ESM Node.js environment, consider using a tool like `createRequire` from the `module` module, or using a build step to transpile CommonJS to ESM. For browser use, ensure the `auAddressParser.min.js` script is loaded via a `<script>` tag.
Ensure you are using `const parser = require('australia-address-parser');` for Node.js CommonJS. In a browser, verify that `auAddressParser.min.js` is loaded and you are calling `auAddressParser.parseLocation(...)`.Review the input address string for unusual formatting. Consult the package's GitHub issues for similar reports or consider contributing improvements to its regex patterns for better coverage.
No dependency data recorded yet.