1.3.3 • Published 5 months ago

mexican-utils v1.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

MEXICAN-UTILS

npm version install size

ES Mexico

Esta es una librería diseñada para tener centralizadas todas las utilidades que suelen ser usadas para sistemas mexicanos, con opción de utilizar en CommonJS o ESM.

Instalación

npm install mexican-utils --save

Uso

  1. Crear un CURP
import { createCURP } from "mexican-utils";

const CURP = createCURP(
  "Andrés Manuel", // Nombre
  "López", // Apellido paterno
  "male", // Género
  "tabasco", // Estado
  "1953-11-13", // Fecha de nacimiento (YYYY-MM-DD)
  "Obrador" // Apellido materno (opcional). Cadena de texto vacía por defecto
);

console.log(CURP);
// Resultado: "LOOA531113HTCPBN07"
  1. Validar un CURP
import { validateCURP } from "mexican-utils";

const isValidCURP = validateCURP("LOOA531113HTCPBN07");

console.log(isValidCURP);
// Resultado: true

Fuentes

Esta librería está hecha tomando como ejemplo lo siguiente:

EN United States

This is a library designed to have centralized all the utilities that are usually used for Mexican systems, with the option to use in CommonJS or ESM.

Installation

npm install mexican-utils --save

Usage

  1. Create a CURP
import { createCURP } from "mexican-utils";

const CURP = createCURP(
  "Andrés Manuel", // Name
  "López", // Paternal surname
  "male", // Genre
  "tabasco", // State
  "1953-11-13", // Date of birth (YYYY-MM-DD)
  "Obrador" // Maternal surname (optional). Empty string by default
);

console.log(CURP);
// Output: "LOOA531113HTCPBN07"
  1. Validate a CURP
import { validateCURP } from "mexican-utils";

const isValidCURP = validateCURP("LOOA531113HTCPBN07");

console.log(isValidCURP);
// Output: true

Sources

This library is built using the following as an example:

1.3.3

5 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.3.0

10 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.2.0

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.0.0

10 months ago