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/divipola

v0.1.1

Published

Departamentos y municipios de Colombia con los códigos DIVIPOLA del DANE.

Readme

@colombia-kit/divipola

Departamentos y municipios de Colombia con los códigos DIVIPOLA del DANE. No tiene dependencias y funciona desde Node 18, con ESM y CommonJS. Los datos se comparan cada mes con la fuente oficial.

Forma parte de colombia-kit.

Instalación

npm install @colombia-kit/divipola

Ejemplos

import { buscarMunicipio, departamentos, municipios, porCodigo } from '@colombia-kit/divipola';

departamentos()[0]; // { codigo: '05', nombre: 'Antioquia', nombreOficial: 'ANTIOQUIA' }

municipios('88').map((m) => m.nombre); // ['San Andrés', 'Providencia']

buscarMunicipio('medellin')[0]?.codigo; // '05001'
buscarMunicipio('cali')[0]?.nombre; // 'Santiago de Cali'

porCodigo('05')?.nombre; // 'Antioquia'
porCodigo('05001')?.nombre; // 'Medellín'
porCodigo('99999'); // null

API

| Función | Devuelve | Qué hace | | -------------------------- | ----------------------------------- | ------------------------------------------------------------ | | departamentos() | readonly Departamento[] | Lista los departamentos, incluido Bogotá, D.C. | | municipios(codigoDepto?) | readonly Municipio[] | Lista los municipios, todos o los de un departamento | | buscarMunicipio(nombre) | readonly Municipio[] | Busca sin distinguir mayúsculas, tildes ni puntuación | | porCodigo(codigo) | Departamento \| Municipio \| null | Busca por código de 2 dígitos (departamento) o 5 (municipio) |

buscarMunicipio devuelve primero las coincidencias exactas, después las de palabras completas y por último las parciales. Varios municipios pueden compartir nombre: narino encuentra tres. La ñ se compara como n.

Ninguna función lanza errores. Los códigos deben ser texto, porque como número se perdería el cero inicial de 05001.

Tipos

interface Departamento {
  codigo: CodigoDepartamento; // '05' | '08' | …
  nombre: string; // 'Valle del Cauca'
  nombreOficial: string; // 'VALLE DEL CAUCA', tal como lo publica el DANE
}

interface Municipio {
  codigo: CodigoMunicipio; // '05001' | '05002' | …
  nombre: string;
  nombreOficial: string;
  tipo: 'Municipio' | 'Isla' | 'Área no municipalizada';
  codigoDepartamento: CodigoDepartamento;
  departamento: string;
  latitud: number;
  longitud: number;
}

nombre se deriva de nombreOficial con una regla automática. Si necesitas el nombre exacto de la fuente, usa nombreOficial.

Cargar solo lo necesario

Los datos de municipios pesan cerca de 225 KB sin comprimir. Si solo necesitas una parte, importa desde su entrada:

import { departamentos } from '@colombia-kit/divipola/departamentos'; // no carga los municipios
import { buscarMunicipio, municipios } from '@colombia-kit/divipola/municipios';

Licencia

El código usa licencia MIT. Los datos son del DANE y se distribuyen bajo CC BY-SA 4.0, con transformaciones de formato y nombres derivados. Los detalles están en LICENSE.