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

@apifactory/openapi-builder

v1.0.5

Published

CLI para trabajar con contratos OpenAPI 3: modularizar, generar bundle, documentación Markdown y convertir a Swagger 2.0.

Readme

OpenAPI Builder

CLI para trabajar con contratos OpenAPI 3: modularizar especificaciones monolíticas, generar bundle consolidado, documentación Markdown y convertir a Swagger 2.0.

🎯 Propósito

Herramienta orientada a "API contract operations" que permite convertir una especificación OpenAPI 3.x monolítica en una estructura modular mantenible, consolidarla en un bundle validado, generar documentación y exportar a Swagger 2.0 para compatibilidad legacy.

✨ Características

  • Modularización: Divide especificaciones OpenAPI monolíticas en estructura modular organizada
  • Bundling: Consolida módulos en un bundle OpenAPI 3 validado
  • Documentación: Genera documentación Markdown automática desde el bundle
  • Compatibilidad: Convierte OpenAPI 3.x a Swagger 2.0
  • Clean Architecture: Implementa arquitectura hexagonal (capas, puertos/adaptadores)
  • Validación: Valida especificaciones antes y después de las transformaciones

📋 Requisitos

  • Node.js >= 16
  • npm >= 8

📦 Instalación

npm install -g @apifactory/openapi-builder

O como dependencia del proyecto:

npm install --save-dev @apifactory/openapi-builder

🚀 Uso

Comando: modularize

Divide un OpenAPI monolítico en estructura modular con corrección de referencias y deduplicación.

openapi-builder modularize --build ./api/petstore-oas3.0.0.yaml

Salida: ./src/ con estructura modular (main.yaml + components/ + paths/)

Comando: bundle

Consolida estructura modular en bundle OpenAPI 3.

openapi-builder bundle -i ./src/main.yaml -o ./dist/bundle.yaml

Opciones:

  • -i, --input: Entrypoint modular (default: ./src/main.yaml)
  • -o, --output: Ruta del bundle (default: ./dist/bundle.yaml)

Comando: docs

Genera documentación Markdown desde el bundle.

openapi-builder docs -i ./dist/bundle.yaml -o ./docs/api.md

Opciones:

  • -i, --input: Bundle OpenAPI (default: ./dist/bundle.yaml)
  • -o, --output: Ruta Markdown (default: ./docs/api.md)

Comando: swagger2

Convierte OpenAPI 3.x a Swagger 2.0.

openapi-builder swagger2 -i ./dist/bundle.yaml -o ./dist/swagger2.yaml

Opciones:

  • -i, --input: Bundle OpenAPI 3 (default: ./dist/bundle.yaml)
  • -o, --output: Ruta Swagger 2 (default: ./dist/swagger2.yaml)

📁 Estructura de Salida

proyecto/
├── src/                    # Estructura modular (modularize)
│   ├── main.yaml
│   ├── components/
│   └── paths/
├── dist/                   # Outputs consolidados
│   ├── bundle.yaml        # Bundle OpenAPI 3 (bundle)
│   └── swagger2.yaml      # Swagger 2.0 (swagger2)
└── docs/                   # Documentación
    └── api.md             # Docs Markdown (docs)

⚙️ Configuración

Los comandos pueden personalizarse mediante archivos YAML en ./config/:

  • config/modularize.yaml: Configuración de modularización
  • config/bundle.yaml: Opciones de bundling
  • config/swagger2.yaml: Configuración de conversión
  • config/logging.yaml: Configuración de logging

🏗️ Arquitectura

El proyecto sigue Clean Architecture con capas claramente definidas:

bin/
├── interface/          # CLI, menús, presenters
├── application/        # Use cases, ports
├── domain/            # Entities, services, value objects
└── infrastructure/    # Adapters (Redocly, Widdershins, etc.)

Ver ARCHITECTURE.md para más detalles.

📖 Documentación

🤝 Contribuir

Las contribuciones son bienvenidas. Por favor:

  1. Lee la guía de contribución
  2. Respeta las reglas de arquitectura (domain no importa infrastructure)
  3. Mantén compatibilidad con los flags del CLI

📄 Licencia

MIT

🔗 Enlaces Útiles