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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@afrigis/vue-address-search

v0.0.2

Published

The AfriGIS VueJs Address Search composable is aimed at creating accessible underlying logic and functionality to implement AfriGIS Search UI components without prescribing a specific visual style.

Readme

AfriGIS VueJs Address Search

The AfriGIS VueJs Address Search composable is aimed at creating accessible underlying logic and functionality to implement AfriGIS Search UI components without prescribing a specific visual style.

Quick features

Configure Debounce rate

The debounce rate is the time, measured in milliseconds, to wait after initial input before registering any subsequent inputs. The default setting is 350ms.

Configure Minimum characters for suggestions

Specify the minimum number of characters of input required before address suggestions are returned. The default is 3 characters.

Configure Max Results for suggestions

Specify the maximum number of address suggestions to return in the results. The default value is 5, but values of between 1 and 20 are accepted.

Configure Include Types for autocomplete and address search

Specify an array of string for the address types to include in the suggestions for Autocomplete API and Geocode API (address search). Refer to Address types for more details.

Configure Exclude Types for autocomplete

Define which address types to include in the suggestions for Autocomplete API, using an array of strings. Refer to Address types for more details.

Configure Payload Format for Selected Addresses

AfriGIS provides detailed address information using the Place Details API by structuring the results by address type. Alternatively, the results can be returned in a structure suitable for deliveries by using the Delivery Address Format API

Running Examples

  • Clone the repo
  • Run NPM Install
  • Run Development Server
npm run serve

Initialisation

const inputText = ref('');
const apiKey = ref('YOUR_API_KEY');

const {
  clear,
  isSelected,
  suggestions,
  search,
  selectedAddress,
  selectSuggestion,
  setAddressComponentsFormat,
  setApiKey,
  setExcludeTypes,
  setIncludeTypes,
  setMaxResults,
  setJwtToken,
} = useAfrigisAddressSearch(
  inputText,
  {
    apiKey: apiKey.value,
    // Further options are optional
  },
);

Initialisation takes a ref for input text and an options object as input.

An explanation of the properties follows:

export interface IAfrigisVueAddressSearchOptions {
  // API key for authentication.
  // Required
  apiKey: string;                                    

  // Default is "https://afrigis.services"                                      
  baseUrl?: string;

  // Minimum characters required before suggestions engine kick in. Default is 3 characters                                                                           
  minChars?: number;                                                                            

  // Debounce rate in milliseconds, default is 350ms
  debounceMs?: number;                              

  // Maximum amount of suggestions to return, a value between 1 and 20, default is 5                                            
  maxResults?: number;

  // Array of strings to specify which types to include in suggestions, refer to https://developers.afrigis.co.za/oas3/autocomplete-api/api/v3/autocomplete
  includeTypes?: string[]; // array of strings

  // Array of strings to specify which types to exclude in suggestions, refer to https://developers.afrigis.co.za/oas3/autocomplete-api/api/v3/autocomplete
  excludeTypes?: string[]; // array of strings

  // Specifies which format to return the selected Address Payload in. Default is 'details'
  addressComponentsFormat?: 'details' | 'delivery';

  // JWT token for authentication
  jwtToken?: string;
}

Composable Instance computed Properties

isSelected

Indicator used to show if a suggestion has been selected. Is set to true before the selected address payload is retrieved.

suggestions

Array, with a list of suggestions for an input, elements implement IAfriGISAddressSearchSuggestion.

selectedAddress

Object, containing the payload of a selected Address. Format depends on the addressComponentsFormat that was set.

Composable Instance functions

clear()

Resets the selected Address and the suggestions

inputChanged(input: string)

Fires off the call to retrieve autocomplete suggestions

search(query: string)

Fires off the call to retrieve address search suggestions (a backup to autocomplete)

selectSuggestion(reference:string)

Fires off the call to retrieve the Address Information for a specific address reference

setApiKey(apiKey: string)

Sets the API key (useful in a multi-tenant situation)

setAddressComponentsFormat(format: 'details' | 'delivery')

Sets the Address Information Format for selected Addresses

setToken(token: string)

Sets the JWT token. Necessary for long-running frontends as the JWT token expires in 60 minutes.

setIncludeTypes(values: string[])

Sets the Include Types to limit suggestions to specific address types.

setExcludeTypes(values: string[])

Sets the Exclude Types to exclude specific address types from suggestions.