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

@colombia-kit/direcciones

v0.1.1

Published

Parsea, normaliza y formatea direcciones colombianas.

Readme

@colombia-kit/direcciones

Parsea, normaliza y formatea direcciones colombianas. No tiene dependencias y funciona desde Node 18, con ESM y CommonJS.

Forma parte de colombia-kit.

Instalación

npm install @colombia-kit/direcciones

Ejemplos

import { formatearDireccion, parsearDireccion } from '@colombia-kit/direcciones';

const direccion = parsearDireccion('kra 7a no. 32b-16 apto 301');
// {
//   tipoVia: 'Carrera',
//   numeroVia: '7',
//   letraVia: 'A',
//   numeroCruce: '32',
//   letraCruce: 'B',
//   placa: '16',
//   complemento: 'Apartamento 301',
// }

formatearDireccion(direccion); // 'Cra 7A # 32B-16 Apto 301'
formatearDireccion(direccion, { estilo: 'largo' }); // 'Carrera 7 A # 32 B - 16 Apartamento 301'

parsearDireccion('Cra 7 con Cl 16'); // null

API

| Función | Devuelve | Qué hace | | -------------------------------------- | ------------------- | ------------------------------------------------ | | parsearDireccion(texto) | Direccion \| null | Separa la dirección y normaliza sus variantes | | formatearDireccion(dir, { estilo? }) | string \| null | Escribe la dirección en estilo corto o largo |

Ninguna función lanza errores.

Campos de Direccion

Todos los valores son texto, salvo los dos bis. Los campos opcionales solo aparecen si la dirección los trae.

| Campo | Ejemplo | Notas | | ---------------------------------- | -------------------------- | ----------------------------------------------------- | | tipoVia | 'Avenida Carrera' | Siempre el nombre completo | | numeroVia | '7', 'El Dorado' | Número o nombre de la vía | | letraVia?, letraCruce? | 'A', 'EE' | En mayúsculas | | bisVia?, bisCruce? | true | | | letraBisVia?, letraBisCruce? | 'A' | La letra de Calle 39 Bis A | | cuadranteVia?, cuadranteCruce? | 'Sur' | Norte, Sur, Este u Oeste | | numeroCruce | '32' | | | placa | '05', '20A', '48/50' | Conserva los ceros, porque 10-05 no es 10-5 | | complemento? | 'Apartamento 301' | Todo lo que sigue a la placa, también barrio o ciudad |

Qué reconoce

  • Tipos de vía: Carrera, Calle, Avenida, Avenida Calle, Avenida Carrera, Diagonal, Transversal, Circular, Circunvalar, Autopista, Troncal y Vía, con sus abreviaturas (Cra, Kra, Cr., KR, Cll, AC, AK…).
  • Marcadores: #, No., N°, Nº, Nro, Número, o ninguno (Carrera 43 38 Sur 35).
  • Complementos: apartamento, torre, interior, local, oficina, piso, edificio, bloque, manzana, casa, barrio y otros, con sus abreviaturas.

La lista completa está en data/vias.json.

Cuándo devuelve null

Necesita tipo de vía, número o nombre, cruce y placa. Devuelve null en lugar de adivinar cuando:

  • Es una referencia: Cra 7 con Cl 16, Km 5 vía Tunja, Barrio Garupal Mz 36 Cs 10.
  • El tipo de vía no va al inicio: Edificio Blu Carrera 2 # 12-44.
  • Trae dos vías o más números de los esperados: Calle 5 Cra 4-12, Cra 8 # 21-03-17.

Reglas para casos ambiguos

  • E se lee como letra, porque existen direcciones como Cra 1 E y 103 EE. Para Este hay que escribir Este.
  • N en la vía es Norte solo si después viene un marcador: Av 2N # 10-70. En Cra 9 N 5-56 es el marcador de número. En el cruce siempre es Norte.
  • S y O se leen como Sur y Oeste antes de la placa. Después de la placa solo cuenta la palabra completa.
  • Vías con nombre: el marcador es obligatorio, y sin él Avenida El Dorado 68-90 devuelve null.
  • Una letra después de la placa solo es parte de ella si va pegada: 16A sí, y 16 A queda en el complemento.

Licencia

MIT