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

moca-plugin-generator

v1.0.0

Published

Generador para plugins Cordova en el ecosistema MOCA

Readme

generator-moca-plugin

Generador Yeoman para scaffolding de plugins Cordova con soporte multiplataforma (Android + iOS) y estructura estandarizada para el equipo.


🧠 Convenciones y generación automática

Este generador crea la estructura de un plugin Cordova utilizando buenas prácticas de naming y automatización.


🔤 Formato del pluginName

El valor de pluginName se solicita al usuario y puede contener mayúsculas, espacios o caracteres especiales. Este valor se utiliza como base para derivar otros campos automáticamente.

Ejemplo de entrada:

Mi Plugin Super Copado

🪄 Generación automática de pluginId

El pluginId se genera automáticamente usando el siguiente formato:

moca.plugin.<nombre-del-plugin>

El <nombre-del-plugin> se deriva del pluginName, aplicando:

  • Conversión a minúsculas
  • Eliminación de caracteres especiales
  • Reemplazo de espacios por guiones
  • Reemplazo de guiones por puntos

🔧 Ejemplo:

pluginName = "Mi Plugin Súper Copado"
// nombre intermedio: "mi-plugin-super-copado"
→ pluginId final = "moca.plugin.mi.plugin.super.copado"

Este valor se inyecta automáticamente en el plugin.xml y otras partes del proyecto.


📦 Convención para nombres de paquetes (Kotlin)

Si necesitás construir un nombre de paquete para Kotlin (src/main/java/...), podés usar una transformación aún más estricta:

pluginName.toLowerCase()
  .replace(/\s+/g, '')        // elimina espacios
  .replace(/[^a-z0-9]/g, '')  // elimina caracteres no válidos

Ejemplo:

pluginName = "Image Capture"
→ "imagecapture"
→ Ruta final: src/main/java/moca/plugin/imagecapture/Example.kt

🧰 Conversión útiles utilizadas internamente

// "Image Capture" → "imagecapture"
pluginName.toLowerCase().replace(/\s+/g, '');

// "Mi Plugin Copado" → "mi.plugin.copado"
pluginName.toLowerCase()
  .replace(/\s+/g, '-')            // "mi-plugin-copado"
  .replace(/[^a-z0-9\-]/g, '')     // limpia
  .replace(/-/g, '.');              // "mi.plugin.copado"

✅ Resultado final esperado

El plugin generado tendrá:

  • Un pluginId con formato homogéneo
  • Código fuente bajo src/
  • Bridge JS en www/index.js
  • Estructura lista para Android e iOS
  • App de pruebas integrada
cordova-plugin-mi-plugin/
├── src/
│   ├── android/
│   ├── ios/
│   ├── bridge/
│   └── tests/
├── www/
├── plugin.xml
├── package.json
├── README.md
├── tsconfig.json
├── tsconfig.types.json
└── webpack.config.js

🚀 Uso

npm install -g yo
cd generator-moca-plugin
npm link
cd /path/to/test-folder --> Osea armar la carpeta del plugin
yo moca-plugin

cd /path/new-project
npm i --> Esto es para levantar las dependencias en el package.json

🧹 Para eliminar el plugin generado

cordova plugin remove @moca/plugin-mi-plugin
rm -rf plugins/moca-plugin-mi-plugin

generator-moca-plugin

Generador de plugins Cordova para el ecosistema MOCA.

Uso rápido

Uso desde npm/npx

npx @moca/generator-moca-plugin

Uso local

npm install -g @moca/generator-moca-plugin
moca-plugin