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

mx-bancos

v2.0.0

Published

Bancos e instituciones participantes de SPEI (Banxico) con validación y generación de CLABE

Readme

mx-bancos

Catálogo de los bancos e instituciones que participan en SPEI, tomado de Banco de México, más validación y generación de cuentas CLABE.

npm CI License: MIT

  • 97 instituciones: banca múltiple, banca de desarrollo, participantes no bancarios (casas de bolsa, SOFIPOs, fintech como Nu, Mercado Pago o Spin by OXXO) y Banxico.
  • Cada institución trae su código CLABE de 3 dígitos y su clave SPEI de 5.
  • Valida el dígito verificador y que el banco siga participando en SPEI.
  • Sin dependencias y sin llamadas a internet. Funciona con import y require en Node 20 o superior, con tipos de TypeScript.

Instalación

npm install mx-bancos

Validar una CLABE

import { validarCLABE, extraerInfoCLABE } from 'mx-bancos';
// o: const { validarCLABE } = require('mx-bancos');

validarCLABE('002180000118359710');     // true
validarCLABE('002 180 00011835971 0');  // true, acepta espacios y guiones
validarCLABE('002180000118359711');     // false, digito verificador incorrecto

extraerInfoCLABE('012180012345678909');
// {
//   clabe: '012180012345678909',
//   codigoBanco: '012',
//   codigoPlaza: '180',
//   numeroCuenta: '01234567890',
//   digitoVerificador: '9',
//   banco: { codigo: '012', claveSpei: '40012', nombre: 'BBVA MEXICO', tipo: 'Banca múltiple' }
// }

validarCLABE también revisa que el banco esté en el catálogo vigente de SPEI. Una CLABE de un banco que ya desapareció, como IXE (032), tiene el dígito verificador correcto pero no puede recibir transferencias:

validarCLABE('032180000118359719');                            // false
validarCLABE('032180000118359719', { verificarBanco: false }); // true
extraerInfoCLABE('032180000118359719').banco;                  // null

Buscar bancos

import { buscarBanco, buscarBancoPorNombre, getBancos } from 'mx-bancos';

buscarBanco('012');      // por codigo CLABE
buscarBanco(12);         // tambien como numero
buscarBanco('40012');    // por clave SPEI
// { codigo: '012', claveSpei: '40012', nombre: 'BBVA MEXICO', tipo: 'Banca múltiple' }

buscarBancoPorNombre('mercado pago'); // sin importar acentos ni mayusculas
getBancos();                          // las 97 instituciones

Generar CLABEs de prueba

import { generarCLABE, formatearCLABE, calcularDigitoVerificador } from 'mx-bancos';

generarCLABE('722', '969', '01234567890'); // '722969012345678902'
generarCLABE('032', '180', '1');           // null, IXE ya no participa en SPEI
formatearCLABE('002180000118359710');      // '002 180 00011835971 0'
calcularDigitoVerificador('00218000011835971'); // 0

API

| Función | Devuelve | |---|---| | getBancos() | Todas las instituciones | | buscarBanco(codigo) | Institución por código CLABE o clave SPEI, o null | | buscarBancoPorNombre(texto) | Instituciones cuyo nombre contiene el texto | | validarCLABE(clabe, { verificarBanco }) | true si es válida; verificarBanco es true por defecto | | extraerInfoCLABE(clabe) | Banco, plaza, cuenta y verificador, o null | | generarCLABE(banco, plaza, cuenta) | CLABE con verificador, o null | | calcularDigitoVerificador(primeros17) | Dígito de 0 a 9 | | formatearCLABE(clabe) | 'BBB PPP CCCCCCCCCCC V' | | getEstadisticas() | Totales por tipo y fecha del catálogo | | infoCatalogo() | Fuente, URL y fecha |

getEstadisticas();
// { totalBancos: 97, porTipo: { 'Banco central': 1, 'Banca múltiple': 46, 'Banca de desarrollo': 6, 'Participante no bancario': 44 }, fechaCatalogo: '2026-11-19' }

Datos

  • Fuente: lista de instituciones que publica Banco de México en su servicio de Comprobante Electrónico de Pago (CEP), es decir, los participantes de SPEI.
  • Fecha del catálogo incluido: 2026-11-19. Hoy son 97 instituciones.
  • Tipo: se deduce del prefijo de la clave SPEI: 40 banca múltiple, 37 banca de desarrollo, 90 participante no bancario y 2 Banco de México.
  • Nombres: tal como los publica Banxico (por ejemplo BBVA MEXICO, NUBANK).
  • Actualización: node scripts/actualizar-catalogo.mjs AAAA-MM-DD descarga la lista y regenera src/catalogo.js. El script se detiene si el formato cambia o si dos instituciones comparten código.

Cambios

Ver CHANGELOG.md. La versión 2.0.0 cambia el catálogo y algunos campos.

Licencia

MIT