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

localiz-ar-node

v3.0.0

Published

Verificar los datos de localiz.ar con NodeJS

Readme

LOCALIZ.AR (BACK-END CON NODE)

Verificación de direcciones argentinas generadas con la librería Front-End de localiz.ar.

Este paquete permite validar en el Back-End los objetos de dirección creados automáticamente por el formulario de localiz.ar, asegurando que los IDs enviados por el cliente existan realmente en la base de datos.


Instalación

npm install localiz-ar-node

Uso básico

const localiz_ar = require("localiz-ar-node")

const result = await localiz_ar.verify({
  prov_id: 153536,
  city_id: 11909161,
  street_id: 0,
  number: 123,
  floor: "Departamento 21"
})

if(result[0]) {
  console.log("Dirección válida")
} else {
  console.log("Error en el campo:", result[1])
}

Método verify()

El método verify() es una función asincrónica y cuenta con los siguientes parametros:

verify(data, checkLevel)

  • data || Object = datos extraídos de la librería Front-End
  • checkLevel || Number = nivel de verificación de datos (ver tabla en la sección correspondiente abajo)

El retorno será un array con la siguiente estructura:

[status,property,references]

  • status || Boolean = devuelve false si algúna propiedad del objeto data es incorrecta.
  • property || String = si status es false, devuelve el nombre de la propiedad incorrecta del objeto data
  • references || Object = devuelve el nombre real de los campos según su id. Por ejemplo: si prov_id es igual a 153536, el objeto references va a tener una propiedad prov que diga La Rioja.

IMPORTANTE: si hay un error de conexión con la base de datos, el método devolverá [false, "internal"]. Al recibir esto se recomienda intentar hacer el request de nuevo en unos segundos. Si el error persiste porfavor reportarlo en la sección de issues.


Formato del objeto data

{
  prov_id: Number,
  city_id: Number,
  street_id: Number,
  number: Number,
  floor: String
}

Estos valores son generados automáticamente por el método validate() de la librería Front-End de localiz.ar.


Niveles de verificación

| Nivel | Verificación | |:-:|:-:| | 1 | Provincia | | 2 | Provincia y ciudad | | 3 | Provincia, ciudad y calle | | 4 | Provincia, ciudad, calle y número de calle | | 5 | Provincia, ciudad, calle, número de calle y piso |

(el nivel predeterminado es 5)

Ejemplo:

await localiz_ar.verify(data, 3)

Esto verificará:

  • provincia (prov_id)
  • ciudad (city_id)
  • calle (street_id)

pero ignorará número (number) y piso (floor).


License

localiz.ar is made available under the Open Database License (ODbL):

https://opendatacommons.org/licenses/odbl/1.0/

Any rights in individual contents of the database are licensed under the Database Contents License (DbCL):

https://opendatacommons.org/licenses/dbcl/1.0/

Data sources

© OpenStreetMap contributors
https://www.openstreetmap.org/copyright

Contains data from Servicio GeoRef – Instituto Geográfico Nacional (Argentina), modified.
Licensed under CC BY 4.0
https://creativecommons.org/licenses/by/4.0/