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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mcc-list-en-es

v1.0.1

Published

Librería para obtener y buscar MCC (Merchant Category Codes) en distintos idiomas

Readme

# 📦 MCC Codes Utility

Una librería sencilla para **trabajar con códigos MCC (Merchant Category Codes)** en español o inglés.

Permite:

- Obtener todos los MCCs en un idioma.
- Buscar un MCC específico por su código.
- Buscar MCCs por texto dentro de su descripción.

---

## 📥 Instalación

Primero instala el paquete:

```bash
npm install mcc-list-en-es
# o con yarn
yarn add mcc-list-en-es
```

📖 Uso básico

Importa las funciones principales desde la librería:

import { getAllMccs, getMccByCode, searchMccs } from "mcc-list-en-es";

Cada función devuelve objetos MCC con la siguiente estructura:

{
  "combined_description": "Veterinary Services",
  "edited_description": "Veterinary Services",
  "id": 0,
  "irs_description": "Veterinary Services",
  "irs_reportable": "Yes",
  "mcc": "0742",
  "usda_description": "Veterinary Services"
}

⚡ Funciones disponibles

1. getAllMccs

Obtiene todos los códigos MCC en el idioma solicitado.

const allSpanish = getAllMccs("es");
const allEnglish = getAllMccs("en");

Parámetros

  • lang: "es" o "en" (opcional, por defecto "es").

Devuelve Un array con todos los MCCs en el idioma seleccionado.

Ejemplo

const mccs = getAllMccs("es");

console.log(mccs.slice(0, 2));
/*
[
  {
    combined_description: "Servicios veterinarios",
    edited_description: "Servicios veterinarios",
    id: 0,
    irs_description: "Servicios veterinarios",
    irs_reportable: "Yes",
    mcc: "0742",
    usda_description: "Servicios veterinarios"
  },
  {
    combined_description: "Agricultural Co-operatives",
    edited_description: "Cooperativas agrícolas",
    id: 1,
    irs_description: "Agricultural Co-operatives",
    irs_reportable: "No",
    mcc: "0763",
    usda_description: "Agricultural Co-operatives"
  }
]
*/

2. getMccByCode

Busca un MCC específico por su código.

const mcc = getMccByCode("0742", "en");
console.log(mcc);

Parámetros

  • code: string → El código MCC (ejemplo: "0742").
  • lang: "es" o "en" (opcional, por defecto "es").

Devuelve Un objeto con los datos del MCC o undefined si no existe.

Ejemplo

const mcc = getMccByCode("0742", "en");

console.log(mcc);
/*
{
  combined_description: "Veterinary Services",
  edited_description: "Veterinary Services",
  id: 0,
  irs_description: "Veterinary Services",
  irs_reportable: "Yes",
  mcc: "0742",
  usda_description: "Veterinary Services"
}
*/

3. searchMccs

Busca MCCs cuyo texto aparezca dentro de la descripción.

const results = searchMccs("restaurant", "en");
console.log(results);

Parámetros

  • query: string → Texto a buscar en la descripción.
  • lang: "es" o "en" (opcional, por defecto "es").

Devuelve Un array con los MCCs que contienen el texto buscado.

Ejemplo

const results = searchMccs("restaurant", "en");

console.log(results.slice(0, 2));
/*
[
  {
    combined_description: "Eating places and restaurants",
    edited_description: "Restaurants",
    id: 100,
    irs_description: "Eating places and restaurants",
    irs_reportable: "Yes",
    mcc: "5812",
    usda_description: "Eating places and restaurants"
  },
  {
    combined_description: "Drinking Places (Alcoholic Beverages)",
    edited_description: "Bars and Pubs",
    id: 101,
    irs_description: "Drinking Places",
    irs_reportable: "Yes",
    mcc: "5813",
    usda_description: "Drinking Places (Alcoholic Beverages)"
  }
]
*/

📚 Casos de uso

  • Crear un buscador de MCCs por palabra clave.
  • Mapear el código MCC de una transacción a su descripción.
  • Mostrar un catálogo completo de MCCs en un idioma (ej. lista desplegable).


📄 Licencia

MIT – Libre para usar y modificar.