The `comuni-json` package provides an unofficial database of Italian municipalities in a static JSON format, integrating data from official ISTAT (National Institute of Statistics) and ANCI (National Association of Italian Municipalities) sources. The npm package is currently at version `1.0.0`, with the underlying data last updated to January 1, 2020, encompassing 7904 municipalities. The project maintains an irregular release cadence, typically updating in response to new ISTAT administrative changes or Poste Italiane's CAP (Postcode) revisions. A key characteristic is its open-source nature, offering a readily accessible dataset for development and research. Crucially, the project explicitly states that the completeness and correctness of the CAP data cannot be guaranteed, making it unsuitable for professional applications requiring absolute data reliability, in contrast to commercial, paid services. The dataset structure includes fields such as `nome` (name), `codice` (ISTAT code), `zona` (geographic zone), `regione` (region), `provincia` (province), `sigla` (vehicle registration plate code), `codiceCatastale` (cadastral code), `cap` (an array of postcodes), and `popolazione` (population from the 2011 census).
npm install comuni-jsonVerified import paths — ran on the pinned version, not inferred.
Loads the complete list of Italian municipalities and demonstrates basic data access, searching by name, and filtering by region code, highlighting common data structures.
For professional use, consider official, paid services from Poste Italiane.
Update your code to no longer reference the `cm` field. Consider using the `provincia` field for regional subdivisions.
If your application relied on alternative language names within the `nome` field, you will need to adjust your logic or integrate external translation sources.
Cross-reference with official Poste Italiane announcements for the latest CAPs for recently formed communes if absolute accuracy is critical.
Implement checks for empty strings when accessing `codiceCatastale` to prevent unexpected behavior in your application.
Ensure `comuni-json` is installed (`npm install comuni-json`) and the import path is exactly `comuni-json/comuni.json`.
Always check if the result of a search or filter operation is not `undefined` before attempting to access its properties. For example: `const comune = findComune(name); if (comune) { console.log(comune.cap); }`Ensure your type definitions are up-to-date. The `popolazione` field was added in the 2018-10-26 update and is a numeric type. Validate its presence and type if working with potentially older data or strict type checks.
No dependency data recorded yet.