{"_id":"@alexbruf/usaddress-rs-wasm","_rev":"4-ff24e279df2c11bb4a270bba1347d825","name":"@alexbruf/usaddress-rs-wasm","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@alexbruf/usaddress-rs-wasm","version":"0.1.0","license":"MIT","_id":"@alexbruf/usaddress-rs-wasm@0.1.0","maintainers":[{"name":"alexbruf","email":"alex@brufsky.org"}],"dist":{"shasum":"a5a5a02a83ce7011543377a7df3ebbf164b74961","tarball":"https://registry.npmjs.org/@alexbruf/usaddress-rs-wasm/-/usaddress-rs-wasm-0.1.0.tgz","fileCount":6,"integrity":"sha512-I9xpQVWFLvDzFWXj/nJ9uaE0S/itc3Co2Ji7yCVtpjKQ0RJXWE++5OICcdszc2szPRUalvC8mK5gwusw2vK/5g==","signatures":[{"sig":"MEUCIQCVR0XiSBXi/2EEc8SNL13ELI37Mz99o8HAvP0zjU2SvwIgSyMLEjAh7Z2AoNwZcWZ3TieUNQ4NcwFg/ne/m5AVhx8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":696553},"main":"usaddress_rs_wasm.js","type":"module","types":"usaddress_rs_wasm.d.ts","_npmUser":{"name":"alexbruf","email":"alex@brufsky.org"},"_npmVersion":"6.14.18","description":"A wasm wrapper for the usaddress crate","directories":{},"sideEffects":["./snippets/*"],"_nodeVersion":"14.21.3","collaborators":["Alex Brufsky <alex@spacinsider.com>"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/usaddress-rs-wasm_0.1.0_1726873204247_0.5149914446290336","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@alexbruf/usaddress-rs-wasm","version":"0.1.1","license":"MIT","_id":"@alexbruf/usaddress-rs-wasm@0.1.1","maintainers":[{"name":"alexbruf","email":"alex@brufsky.org"}],"dist":{"shasum":"2dc6692f2cba24664e6d4d5d89f43688b498d3b5","tarball":"https://registry.npmjs.org/@alexbruf/usaddress-rs-wasm/-/usaddress-rs-wasm-0.1.1.tgz","fileCount":7,"integrity":"sha512-/C8iwGTvvMgd+Z0H7YVCSFibBHoLN+UZK5FFYB9oyeInaFirHAGJ8QiPjPEjcCt4FO04YEg+euEh7TmBeG9Lqw==","signatures":[{"sig":"MEYCIQCCxavE/DitzI+zZsFO+CVT0gAdCnNxFF4gXljS3pFk3QIhAP+FzdpUlexuuQwmM3JnROzkH96HEsCzPfGtTacsRWOR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":686680},"main":"usaddress_rs_wasm.js","type":"module","types":"usaddress_rs_wasm.d.ts","_npmUser":{"name":"alexbruf","email":"alex@brufsky.org"},"_npmVersion":"6.14.18","description":"A wasm wrapper for the usaddress crate","directories":{},"sideEffects":["./usaddress_rs_wasm.js","./snippets/*"],"_nodeVersion":"14.21.3","collaborators":["Alex Brufsky <alex@spacinsider.com>"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/usaddress-rs-wasm_0.1.1_1726873957709_0.34672190554054194","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@alexbruf/usaddress-rs-wasm","version":"0.1.3","license":"MIT","_id":"@alexbruf/usaddress-rs-wasm@0.1.3","maintainers":[{"name":"alexbruf","email":"alex@brufsky.org"}],"dist":{"shasum":"87964199e09e39d99ebd50f15afe21e5f5a2aa09","tarball":"https://registry.npmjs.org/@alexbruf/usaddress-rs-wasm/-/usaddress-rs-wasm-0.1.3.tgz","fileCount":3,"integrity":"sha512-wHLR84bnPDNYE6OIF+ypSrq0+ORw3QFYk4Jr+y+o7QVsaITUjAG62QX1mMhM9MLM9kPeSR5ODNkMDyQ7xYyyxQ==","signatures":[{"sig":"MEUCIQDcoYd5vkcWRv/jcknffXDuDb+B8ACSNWYFgoQuo0mbswIgYdZnWAejpXuWVJTqoTMUS1+eOOxHjxxLL5ZPKMuHuKM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4888},"main":"./node/usaddress_node.js","type":"module","types":"usaddress_bundler.d.ts","_npmUser":{"name":"alexbruf","email":"alex@brufsky.org"},"_npmVersion":"6.14.18","description":"A wasm wrapper for the usaddress crate","directories":{},"sideEffects":["./usaddress_bundler.js","./snippets/*"],"_nodeVersion":"14.21.3","collaborators":["Alex Brufsky <alex@spacinsider.com>"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/usaddress-rs-wasm_0.1.3_1727793837251_0.12526927629825546","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@alexbruf/usaddress-rs-wasm","version":"0.1.4","license":"MIT","_id":"@alexbruf/usaddress-rs-wasm@0.1.4","maintainers":[{"name":"alexbruf","email":"alex@brufsky.org"}],"dist":{"shasum":"242e6addf4e0c3707e791b8c8e0a5413566dbe46","tarball":"https://registry.npmjs.org/@alexbruf/usaddress-rs-wasm/-/usaddress-rs-wasm-0.1.4.tgz","fileCount":18,"integrity":"sha512-wQyk9Fp0GDEwXx0k2UXfwPY1EEaUED0WZchBmxAzDP8E1pOv/L+R8kr8wV59N8ikrg1SDPKCABZ8SPFn1DKLoQ==","signatures":[{"sig":"MEUCIQCiGCYvJ7PzeaDjicqZn3cjpAMvI66mHCIiUP9Gk7B4qQIgSW63clQGw9YlVFKL5XDrFJTuRrv2l8BDgr5/N58NKEw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2064164},"main":"./node/usaddress_node.js","types":"./node/usaddress_node.d.ts","module":"usaddress_bundler.js","gitHead":"ef7e9975b1e7ccf96f363844f9fc58edfed4a738","_npmUser":{"name":"alexbruf","email":"alex@brufsky.org"},"_npmVersion":"10.1.0","description":"A wasm wrapper for the usaddress crate","directories":{},"sideEffects":["./usaddress_bundler.js","./snippets/*"],"_nodeVersion":"20.9.0","collaborators":["Alex Brufsky <alex@spacinsider.com>"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/usaddress-rs-wasm_0.1.4_1727794392096_0.6099757625584843","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"@alexbruf/usaddress-rs-wasm","collaborators":["Alex Brufsky <alex@spacinsider.com>"],"description":"A wasm wrapper for the usaddress crate","version":"0.1.5","license":"MIT","main":"./node/usaddress_node.js","types":"./node/usaddress_node.d.ts","exports":{".":"./node/usaddress_node.js","./web":"./web/usaddress_web.js","./bundler":"./bundler/usaddress_bundler.mjs"},"_id":"@alexbruf/usaddress-rs-wasm@0.1.5","gitHead":"ef7e9975b1e7ccf96f363844f9fc58edfed4a738","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-7V+71TIZPJgPhRmpPWjBL7IhVvz9weeqrHlQQ5ukLjsxg6j+8ftt6FMI0dFnyAihhanQmPWTEUpYGpUGaaw3Cg==","shasum":"0eb2bdcbf9ac3ec5b42d799194dd7982ddfee32f","tarball":"https://registry.npmjs.org/@alexbruf/usaddress-rs-wasm/-/usaddress-rs-wasm-0.1.5.tgz","fileCount":18,"unpackedSize":2064202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUJjwzsjdNKy1ha4fnf2Kmi+FPn4Ygoay8jYqUAsgtnQIgI8W4rlUVVNyN3wdOIfH9eZlNJcbwUXOYJBCCbOJUh54="}]},"_npmUser":{"name":"alexbruf","email":"alex@brufsky.org"},"directories":{},"maintainers":[{"name":"alexbruf","email":"alex@brufsky.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/usaddress-rs-wasm_0.1.5_1727794533287_0.6205617764635487"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-20T23:00:04.172Z","modified":"2024-10-01T14:55:33.744Z","0.1.0":"2024-09-20T23:00:04.560Z","0.1.1":"2024-09-20T23:12:38.017Z","0.1.3":"2024-10-01T14:43:57.456Z","0.1.4":"2024-10-01T14:53:12.401Z","0.1.5":"2024-10-01T14:55:33.593Z"},"license":"MIT","description":"A wasm wrapper for the usaddress crate","maintainers":[{"name":"alexbruf","email":"alex@brufsky.org"}],"readme":"# usaddress-rs-wasm\n\nA WebAssembly wrapper for the [us-addrs](https://github.com/raphaellaude/us-addrs/) Rust package, providing fast and accurate parsing of unstructured United States address strings into address components.\n\n## Overview\n\nusaddress-rs-wasm brings the power of the us-addrs Rust crate to the web, allowing you to parse US addresses directly in the browser or in Node.js applications. This project wraps the core functionality of us-addrs in a WebAssembly module, making it easy to integrate into JavaScript and TypeScript projects.\n\n## Features\n\n- Parse unstructured US address strings into structured components\n- High-performance address parsing using Rust and WebAssembly\n- Easy integration with web and Node.js applications\n- Compatible with both synchronous and asynchronous usage patterns\n\n## Installation\n\n```bash\nnpm install usaddress-rs-wasm\n```\n\n## Usage\n\n```javascript\nconst { parse } = require('usaddress-rs-wasm');\n\nconst address = \"123 Main St, Anytown, CA 12345\";\nconst result = parse(address);\n\nconsole.log(result);\n```\n\n## API\n\n### `parse(address: string): ParseResult`\n\nParses the given address string and returns a `ParseResult` object.\n\n```typescript\ntype ParseResult = \n  | { data: Array<[string, string]> }\n  | { error: string };\n```\n\n- If parsing is successful, the `data` property will contain an array of tuples, where each tuple represents a parsed component of the address. The first element of the tuple is the component value, and the second element is the component type.\n- If an error occurs during parsing, the `error` property will contain an error message.\n\n## Example\n\n```javascript\nconst { parse } = require('usaddress-rs-wasm');\n\nconst address = \"33 Nassau Avenue, Brooklyn, NY\";\nconst result = parse(address);\n\nif ('data' in result) {\n  console.log(\"Parsed address components:\");\n  for (const [value, type] of result.data) {\n    console.log(`${type}: ${value}`);\n  }\n} else {\n  console.error(\"Error parsing address:\", result.error);\n}\n```\n\nOutput:\n```\nParsed address components:\nAddressNumber: 33\nStreetName: Nassau\nStreetNamePostType: Avenue\nPlaceName: Brooklyn\nStateName: NY\n```\n\n## Building from Source\n\nTo build the WebAssembly module from source, you'll need to have Rust and wasm-pack installed. Then, follow these steps:\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/username/usaddress-rs-wasm.git\n   cd usaddress-rs-wasm\n   ```\n\n2. Build the WebAssembly module:\n   ```\n   wasm-pack build --target web\n   ```\n\n3. The built files will be in the `pkg` directory, ready for use or distribution.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- This project is based on the [us-addrs](https://github.com/raphaellaude/us-addrs/) Rust crate, which is itself inspired by the [usaddress](https://github.com/datamade/usaddress) Python library.\n- Thanks to the [datamade](https://datamade.us/) team for their work on the original usaddress library.\n","readmeFilename":"README.md"}