npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mountainpass/addressr

v1.1.2

Published

Australian Address Validation, Search and Autocomplete

Downloads

84

Readme

Addressr

Addressr

Australian Address Validation, Search and Autocomplete - addressr.io

GitHub license npm npm downloads Docker Image Version (latest by date) Docker Pulls

Addressr Build Status Maintainability Test Coverage

GitHub issues GitHub pull requests Libraries.io dependency status for latest release Join the chat at https://gitter.im/mountainpass-addressr/community

Gitter

Uptime Robot ratio (30 days)

About

Australian Address Validation, Search and Autocomplete

Australian Data Source

Addresses validated against the Geocoded National Address File (referred to as G-NAF), Australia’s authoritative address file.

Software As or NOT As A Service

We love SaaS, but we know its not for everyone. SaaS or self hosted, we've got you covered.

Always Up-To-Date

Addressr automatically updates with the latest data, so you're never out-of-date.

Real-time Address Validation

Add address autocomplete, search and validation to your forms.

Easy To Use API

Build your solution quickly, with our straightforward API.

Run On Your Own Infrastructure or Use Ours

On-premise or in the cloud, run Addressr on your own infrastructure, or leave all the hard work to us.

Completely Free or Pay for Support

That's right, Addressr is completely free Forever. Or for peace of mind for your mission critical solutions, get commercial support you can truly rely on.

ToC

Quick Start

Self Hosted

  1. Install addressr

    npm install @mountainpass/addressr -g

    NOTE: If you are running windows, you'll need to use wsl

  2. Start open search. For example run

    docker pull opensearchproject/opensearch:1.2.4
    docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "plugins.security.disabled=true" opensearchproject/opensearch:1.2.4
  3. Start API server. In a second window run:

    export ELASTIC_PORT=9200
    export ELASTIC_HOST=localhost
    addressr-server-2
  4. Setup the env vars for the data loader. In a third window run:

    export ELASTIC_PORT=9200
    export ELASTIC_HOST=localhost
    export ADDRESSR_INDEX_TIMEOUT=30s
    export ADDRESSR_INDEX_BACKOFF=1000
    export ADDRESSR_INDEX_BACKOFF_INCREMENT=1000
    export ADDRESSR_INDEX_BACKOFF_MAX=10000
    1. Optional - enable geocodes by setting the following env vars for the data loader. In the third window run: NOTE: with geocodes enabled, indexing takes much longer and needs much more memory. Only use turn them on if you need them. You can always add them later.
    export ADDRESSR_ENABLE_GEO=1
    export NODE_OPTIONS=--max_old_space_size=8196
    1. Optional - limit the addresses to a single state by setting the COVERED_STATES env var for the data loader. This dramatically speeds up indexing. For example, in the third window run:
    export COVERED_STATES=VIC,SA

    Valid values are:

    • ACT
    • NSW
    • NT
    • OT
    • QLD
    • SA
    • TAS
    • VIC
    • WA
  5. Run data Loader. In the third window run:

    addressr-loader
  6. OK, so we stretched the truth a bit with the "Quick Start" heading. The truth is that it takes quite a while to download, store and index the 13+ million addresses from data.gov.au. So make a coffee, or tea, or find something else to do and come back in about an hour when it's done.

  7. Search for an address using the command line

    curl -i http://localhost:8080/addresses?q=LEVEL+25,+TOWER+3
  8. An updated G-NAF is released every 3 months. Put addressr-loader in a cron job or similar to keep addressr regularly updated

  9. Wire you address form up to the address-server api.

How it Works

How it works

Additional Settings

| Environment Variable | Value | Description | Default | | -------------------- | ----------- | ----------------------------------------------------- | ------- | | ELASTIC_PROTOCOL | http | Connect to open search over http | ✅ | | ELASTIC_PROTOCOL | https | Connect to open search over https | | | ELASTIC_USERNAME | blank | Connect to open search without authentication | ✅ | | ELASTIC_USERNAME | non-blank | Connect to open search with the specified username | | | ELASTIC_PASSWORD | blank | Connect to open search without authentication | ✅ | | ELASTIC_PASSWORD | non-blank | Connect to open search with the specified password | | | PAGE_SIZE | 8 | Number or records to return in a search | ✅ | | ADDRESSR_ACCESS_CONTROL_ALLOW_ORIGIN | blank | An Access-Control-Allow-Origin response header is not returned | ✅ | | ADDRESSR_ACCESS_CONTROL_ALLOW_ORIGIN | non-blank | An Access-Control-Allow-Origin response header is returned with the value in the environment variable | | | ADDRESSR_ACCESS_CONTROL_EXPOSE_HEADERS | blank | An Access-Control-Expose-Headers response header is not returned | ✅ | | ADDRESSR_ACCESS_CONTROL_EXPOSE_HEADERS | non-blank | An Access-Control-Expose-Headers response header is returned with the value in the environment variable | | | ADDRESSR_ACCESS_CONTROL_ALLOW_HEADERS | blank | An Access-Control-Allow-Headers response header is not returned | ✅ | | ADDRESSR_ACCESS_CONTROL_ALLOW_HEADERS | non-blank | An Access-Control-Allow-Headers response header is returned with the value in the environment variable | |

NOTE: When adjusting PAGE_SIZE, you should take into account how quickly you want the initial results returned to the user. In many use cases, you want this to be as fast as possible. If you need show more results to the user, you are often better off leaving it a 8 and using the paging links to get more results while you are displaying the first 8.

Why is the default 8 and not 10? Mechanical Sympathy

System requirements

Open Search

opensearch >= 1.2.4 with 1.4GiB of memory

Addressr Loader

Default

Node.js >= 12.11.0 with 1GiB of memory

With Geocoding enabled

Node.js >= 12.11.0 with 8GiB of memory

Addressr Server

Node.js >= 12.11.0 with 64MiB of memory