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

@tresdoce-nestjs-toolkit/archetype

v2.0.12

Published

Tresdoce NestJS Toolkit - Módulo informativo de la app

Readme

Módulo que expone un endpoint /info con información de la aplicación y sus dependencias. Está pensado para ser utilizado en NestJS Starter o en cualquier proyecto que siga la misma arquitectura de configuración centralizada.

Glosario


📝 Requerimientos básicos

🛠️ Instalar dependencia

npm install -S @tresdoce-nestjs-toolkit/archetype
yarn add @tresdoce-nestjs-toolkit/archetype

📦 Dependencias internas

Este paquete requiere los siguientes paquetes del toolkit:

| Paquete | Razón | | ------------------------------------------ | ---------------------------------------------------------------- | | @tresdoce-nestjs-toolkit/core | Tipos Typings.AppConfig, decoradores base y utilidades comunes |

⚙️ Configuración

ArchetypeModule requiere que ConfigModule esté disponible globalmente en la aplicación (con isGlobal: true) y que la configuración centralizada esté registrada bajo la clave config (siguiendo el patrón del NestJS Starter).

El módulo usa internamente ConfigService para leer config.project y config.server.appStage, y lee el package.json del proyecto en tiempo de ejecución para construir la respuesta de /info.

👨‍💻 Uso

Importar ArchetypeModule en el módulo principal de la aplicación:

// ./src/app.module.ts
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ArchetypeModule } from '@tresdoce-nestjs-toolkit/archetype';
import config from './config/configuration';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      load: [config],
    }),
    //...
    ArchetypeModule,
    //...
  ],
  //...
})
export class AppModule {}

ArchetypeModule está decorado con @Global(), por lo que el ArchetypeController y el token CONFIG_OPTIONS quedan disponibles en toda la aplicación una vez importado.

Endpoint /info

Una vez registrado el módulo, el endpoint está disponible en:

Schema: <http|https>://<server_url><:port>/<app-context>/info
Example: http://localhost:8080/v1/info

El endpoint está excluido de la documentación Swagger (@ApiExcludeEndpoint()).

Respuesta de ejemplo

{
  "archetypeVersion": "1.2.0",
  "appStage": "dev",
  "apiPrefix": "MY-APP",
  "name": "my-nestjs-app",
  "version": "1.0.0",
  "description": "My NestJS Application",
  "author": {
    "name": "Maximiliano Delgado",
    "email": "[email protected]",
    "url": "https://rudemex.github.io/"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/my-org/my-nestjs-app.git"
  },
  "homepage": "https://github.com/my-org/my-nestjs-app#readme",
  "dependencies": {
    "@tresdoce-nestjs-toolkit/archetype": "^1.2.0",
    "@tresdoce-nestjs-toolkit/health": "^1.2.0",
    "@tresdoce-nestjs-toolkit/http-client": "^1.2.0",
    "@nestjs/common": "^11.0.0",
    "@nestjs/config": "^4.0.0",
    "@nestjs/core": "^11.0.0",
    "@nestjs/platform-express": "^11.0.0",
    "@nestjs/swagger": "^11.0.0"
  },
  "devDependencies": {
    "@nestjs/cli": "^11.0.0",
    "@nestjs/testing": "^11.0.0"
  }
}

Las secciones dependencies y devDependencies solo incluyen paquetes cuyo nombre comienza con @tresdoce-nestjs-toolkit/ o @nestjs/. El resto de dependencias es filtrado intencionalmente.

Exclusión del prefix global

El endpoint /info ya está incluido en corePathsExcludes() del paquete @tresdoce-nestjs-toolkit/core. Si usas ese helper en main.ts, el endpoint queda automáticamente excluido del prefix global:

// ./src/main.ts
import { corePathsExcludes } from '@tresdoce-nestjs-toolkit/core';

app.setGlobalPrefix(`${server.context}`, {
  exclude: [...corePathsExcludes()],
});

Si necesitas excluir el endpoint del prefix global de forma manual, puedes usar la constante manifestControllerExcludes:

import { manifestControllerExcludes } from '@tresdoce-nestjs-toolkit/archetype';

app.setGlobalPrefix(`${server.context}`, {
  exclude: [...manifestControllerExcludes],
});

📖 API Reference

ArchetypeModule

Módulo global (@Global()) que registra el controller y el service de archetype. Importa ConfigModule internamente. Solo necesita ser importado una vez en AppModule.

ArchetypeController

| Método | Path | Descripción | | ------ | ------- | ------------------------------------------------------------------- | | GET | /info | Retorna el manifest completo de la aplicación. Excluido de Swagger. |

ArchetypeService

| Método | Descripción | | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | generateManifest() | Combina getArchetypeVersion() y getApplicationInfo() en un único objeto. | | getArchetypeVersion() | Lee la versión del paquete @tresdoce-nestjs-toolkit/archetype instalado. | | getApplicationInfo() | Lee config.project y config.server.appStage de la configuración centralizada, y filtra las dependencias del package.json del proyecto. | | readFile(pathSegment, filename) | Utilidad interna para leer y parsear archivos JSON. |

Constants

| Export | Tipo | Descripción | | ---------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------- | | CONFIG_OPTIONS | Symbol | Token de inyección para la configuración (Typings.AppConfig). | | manifestControllerExcludes | { path: '/info'; method: RequestMethod.GET }[] | Array con la ruta del endpoint /info, para ser usado en setGlobalPrefix({ exclude: ... }). |

📄 Changelog

Todos los cambios notables de este paquete se documentarán en el archivo Changelog.