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

generador-datos-mx

v1.1.0

Published

Generador de datos de prueba mexicanos realistas para testing y desarrollo

Readme

generador-datos-mx

Librería moderna para generar datos de prueba mexicanos realistas — ideal para testing, desarrollo y demostración de aplicaciones. Genera nombres, RFCs, CURPs, direcciones, teléfonos, CLABEs y más.

npm version License: MIT CI

Features

  • Datos realistas — nombres, apellidos y direcciones mexicanas auténticas
  • RFC y CURP — generación automática de identificadores fiscales
  • NSS y CLABE — Número de Seguridad Social y cuentas bancarias
  • Direcciones completas — con estados, colonias y códigos postales
  • Teléfonos — móviles y fijos con formatos correctos
  • Correos electrónicos — basados en nombres reales
  • Empresas — nombres de empresas con razones sociales
  • TypeScript ready — incluye definiciones de tipos
  • Zero dependencies — solo usa dayjs
  • Cobertura de tests > 85%

Nota: Esta librería genera datos ficticios para testing y desarrollo. Los RFCs, CURPs y CLABEs generados no son válidos oficialmente.

Instalación

npm install generador-datos-mx

Uso

Generar una persona completa

import { generarPersona } from 'generador-datos-mx';

const persona = generarPersona();
console.log(persona);
/*
{
  nombre: 'Juan',
  apellidoPaterno: 'García',
  apellidoMaterno: 'López',
  nombreCompleto: 'Juan García López',
  genero: 'masculino',
  fechaNacimiento: '15/03/1985',
  edad: 39,
  rfc: 'GALJ850315AB1',
  curp: 'GALJ850315HDFRPN01',
  nss: '12850234567',
  telefono: '+52 55 1234 5678',
  email: '[email protected]',
  direccion: 'Avenida Reforma 123, Col. Centro, C.P. 06000, Ciudad de México',
  clabe: '002123456789012345',
  banco: 'Banamex'
}
*/

Generar múltiples personas

import { generarPersonas } from 'generador-datos-mx';

const personas = generarPersonas(100);

const personasJovenes = generarPersonas(50, {
  edadMin: 18,
  edadMax: 30,
  genero: 'femenino'
});

Datos específicos

import { generarRFC, generarCURP, generarCLABE, generarDireccion } from 'generador-datos-mx';

// RFC basado en datos
const rfc = generarRFC({
  nombre: 'María',
  apellidoPaterno: 'López',
  apellidoMaterno: 'García',
  fechaNacimiento: { fecha: '1990-05-20' }
});

// CLABE bancaria
const clabe = generarCLABE();
console.log(clabe);
// { clabe: '012180001234567897', banco: 'BBVA', codigoBanco: '012' }

// Dirección
const direccion = generarDireccion();
console.log(direccion.direccionCompleta);
// 'Avenida Reforma 456 Int. 12, Col. Centro, C.P. 06000, Ciudad de México'

API

| Función | Descripción | Retorna | |---------|-------------|---------| | generarPersona(opciones) | Genera una persona completa con todos sus datos | Object | | generarPersonas(cantidad, opciones) | Genera múltiples personas | Array<Object> | | generarNombre(opciones) | Genera nombre completo | Object | | generarFechaNacimiento(opciones) | Genera fecha de nacimiento | Object | | generarRFC(datosPersona) | Genera RFC | string | | generarCURP(datosPersona) | Genera CURP | string | | generarNSS() | Genera Número de Seguridad Social | string | | generarCLABE(opciones) | Genera CLABE bancaria | Object | | generarTelefono(opciones) | Genera teléfono | Object | | generarDireccion(opciones) | Genera dirección completa | Object | | generarEmail(opciones) | Genera correo electrónico | Object | | generarEmpresa(opciones) | Genera nombre de empresa | Object |

Casos de uso

Seed de base de datos

import { generarPersonas } from 'generador-datos-mx';

async function seedDatabase() {
  const personas = generarPersonas(1000);
  for (const persona of personas) {
    await db.usuarios.insert({
      nombre: persona.nombreCompleto,
      email: persona.email,
      rfc: persona.rfc,
      telefono: persona.telefono,
      direccion: persona.direccion
    });
  }
}

Testing

import { generarPersonas } from 'generador-datos-mx';

describe('Sistema de Registro', () => {
  it('debe registrar usuarios mexicanos', () => {
    const usuarios = generarPersonas(10);
    usuarios.forEach(usuario => {
      const resultado = sistemaRegistro.registrar(usuario);
      expect(resultado).toBe(true);
    });
  });
});

Datos incluidos

  • 60 nombres (30 masculinos + 30 femeninos)
  • 50 apellidos mexicanos comunes
  • 32 estados de México con códigos
  • 8 bancos principales de México

Ecosistema relacionado

Apoyo

Proyecto de código abierto mantenido en mi tiempo libre. Si te fue útil y quieres agradecerlo:

Ko-fi Buy Me a Coffee

Licencia

MIT © Gerardo Lucero, ver LICENSE.