{"library":"parse-address","title":"US Street Address Parser","description":"This package, `parse-address`, currently at version 1.1.2, provides a JavaScript port of the Perl Geo::StreetAddress::US module for parsing US street addresses. It is designed to be highly forgiving and robust, using a regex-based approach to extract components like street number, prefix, street name, type, city, state, and ZIP code from various user-provided address strings. Key features include handling directional prefixes and suffixes, fractional building numbers, building units, grid-based addresses, and both 5 and 9-digit ZIP codes, along with all official USPS abbreviations for street types and state names. The package's release cadence appears to be infrequent, with the last significant version jump (1.0.0) occurring after a long period. Its core differentiator is its direct port from a proven Perl library, emphasizing fault tolerance in parsing diverse address formats prevalent in the United States.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install parse-address"],"cli":null},"imports":["const parser = require('parse-address');","const { parseLocation } = require('parse-address'); // If using object destructuring, requires the 'parser' object to be assigned first, then destructure if module.exports is an object with named keys.\n// More robust: const parser = require('parse-address'); const parsed = parser.parseLocation(...);","<script type=\"text/javascript\" src=\"./node_modules/parse-address/parse-address.min.js\"></script>\n<script>\n  var parsed = parseAddress.parseLocation('1005 N Gravenstein Highway Sebastopol CA 95472');\n</script>"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const parser = require('parse-address');\n\nconst addressString = '1005 N Gravenstein Highway Sebastopol CA 95472';\nconst parsedAddress = parser.parseLocation(addressString);\n\nconsole.log('Original Address:', addressString);\nconsole.log('Parsed Address:', parsedAddress);\n\n// Example of another address type\nconst intersectionString = 'Main St & First Ave, Anytown CA';\nconst parsedIntersection = parser.parseLocation(intersectionString);\nconsole.log('Parsed Intersection:', parsedIntersection);\n\n// Demonstrating robustness with a less formal address\nconst informalAddress = '456 w Elm apt 3B, New York, NY 10001';\nconst parsedInformal = parser.parseLocation(informalAddress);\nconsole.log('Parsed Informal Address:', parsedInformal);","lang":"javascript","description":"Demonstrates how to import the parser and use `parseLocation` to extract components from US street addresses, including common and informal formats.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}