noinfopath-address-parser

A NoInfoPath Address Parser module

Usage no npm install needed!

<script type="module">
  import noinfopathAddressParser from 'https://cdn.skypack.dev/noinfopath-address-parser';
</script>

README

NoInfoPath Address Parser (noinfopath-address-parser)

Overview

Parses a new line or comma separated address into a JSON object of properties.

Installation

npm install noinfopath-address-parser --save

Usage


    describe("Testing address parser", function(){

        it("Testing address ", function(){
            var raw = "Foo Bar (Billing Records)\1234 U.S. 287 Frontage Road\nArlington, TX 76001",
                expected = {
                    "city": "Arlington",
                    "state": "TX",
                    "zip": "76001",
                    "address1": "1234 U.S. 287 Frontage Road",
                    "name1": "Foo Bar (Billing Records)"
                },
                actual = addressParser(raw);

            assert.deepEqual(actual, expected);
        });

    });