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

@pallari/italian-address-client

v1.2.3

Published

Professional isomorphic JS client for certified Italian address lookup and normalization via ANNCSU/DataWS API.

Readme

Italian Address Lookup & Normalization (JS Client)

License: MIT API Status

The most efficient way to integrate certified Italian address lookup into your web applications. This library provides a seamless interface for the DataWS Italian Address API, an independent gateway serving official national data from the ANNCSU database.

Important Disclosure: This is an independent third-party service provided by DataWS. While the data is sourced from official Italian institutional archives (ISTAT & Revenue Agency), the API service and this client are not affiliated with, authorized by, or in any way connected to any government body.

🚀 Why use this?

Inaccurate address data costs money. Whether it's for e-commerce checkouts, shipping forms, or user registration, this client ensures your data is:

  • Verified: Based on official data from ISTAT and Italian Revenue Agency.
  • Formatted: Consistent Title Case formatting (e.g., Via D'Azeglio instead of VIA D'AZEGLIO).
  • Enriched: Includes ISTAT codes, province initials, and region data.

✨ Key Features

  • Zero Dependencies: Pure Vanilla JS (less than 10KB).
  • Geographic Cascading: Automatic filtering from Region > Province > Municipality > Street.
  • Auto-Mapping: Save technical IDs (ISTAT, Street ID) directly to your hidden fields.
  • National Search: Users can type a street name, and the client will automatically identify the correct city.

📦 Installation

Browser (CDN)

Simply include the library in your project via jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/@pallari/[email protected]/italian-address-client.js"></script>

Node.js (NPM)

npm install @pallari/italian-address-client

🛠 Usage

Browser (Professional UI Integration)

The library includes a powerful attachAutocomplete method that handles the entire UI logic for you.

const client = new ItalianAddressClient();
client.attachAutocomplete({
    fields: {
        municipality: document.getElementById('city-input'),
        street: document.getElementById('street-input')
    },
    // NEW: React to user selections with callbacks
    onMunicipalityChange: (municipality) => console.log('City selected:', municipality),
    onStreetChange: (street) => {
        console.log('Street selected:', street);
        // Example: load house numbers for this street
    }
});

Node.js (Server-side Validation/Normalization)

You can use the client to validate or normalize addresses in your backend.

const ItalianAddressClient = require('@pallari/italian-address-client');
const client = new ItalianAddressClient();

async function validateAddress() {
    // Smart Search: automatically splits "Via Roma" into DUG and name
    const streets = await client.searchStreets('Via Roma', { 
        istat_code: '015146',
        smart: true 
    });
    console.log(streets[0]); // Certified data from ANNCSU
}

🛠 Advanced Configuration

attachAutocomplete Options

| Option | Type | Description | | --- | --- | --- | | fields | Object | Map of DOM elements (municipality, street, region, province, street_type). | | outputs | Object | Map of DOM elements to automatically fill with IDs (istat_code, street_id). | | onMunicipalityChange | Function | Callback fired when a municipality is selected. | | onStreetChange | Function | Callback fired when a street is selected. | | onDugChange | Function | Callback fired when a street type (DUG) is selected via <select>. | | onStateChange | Function | Callback fired on any state update. |

searchStreets Options

| Option | Type | Description | | --- | --- | --- | | istat_code | string | Filter results by municipality ISTAT code. | | smart | boolean | (Default: true) Enables automatic DUG/Name splitting. | | dug_id | number | Filter by a specific DUG ID (e.g., 12 for "Vicolo"). | | strict | boolean | (Default: false) If true, only returns exact matches for the detected DUG. |

Advanced: Geographical Filters (Region & Province)

You can use standard <select> menus for higher-level filters. The client handles the cascading logic:

client.attachAutocomplete({
    fields: {
        region: document.getElementById('region-select'), // <select>
        province: document.getElementById('province-select'), // <select>
        municipality: document.getElementById('city-input') // <input>
    }
});

🇮🇹 Supporto Italiano

Cerchi una soluzione per la normalizzazione degli indirizzi in Italia? Questo client ti permette di accedere al database ufficiale nazionale (ANNCSU) per garantire che ogni indirizzo inserito dai tuoi utenti sia certificato e geograficamente corretto.

📄 License

Distributed under the MIT License. See LICENSE for more information.

📧 Enterprise Support

Need a dedicated API key with higher rate limits or custom features? Visit anncsu.dataws.it or contact us at [email protected].