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

@wisemen/nestjs-async-api

v0.0.6

Published

A TypeScript package for generating AsyncAPI v3.0.0 documentation for NestJS applications. Automatically generate YAML specifications and HTML documentation for your asynchronous APIs (WebSockets, message queues, event-driven architectures).

Readme

@wisemen/nestjs-async-api

A TypeScript package for generating AsyncAPI v3.0.0 documentation for NestJS applications. Automatically generate YAML specifications and HTML documentation for your asynchronous APIs (WebSockets, message queues, event-driven architectures).

Features

  • AsyncAPI v3.0.0 Types: Complete TypeScript type definitions for AsyncAPI specification
  • Channel Definitions: Type-safe channel definitions with parameter extraction
  • YAML Generation: Automatically generate AsyncAPI YAML specifications from your code
  • HTML Documentation: Generate beautiful HTML documentation using AsyncAPI templates
  • NestJS Integration: Seamlessly integrates with NestJS decorators and DTOs
  • Schema Generation: Automatic schema generation from TypeScript classes using NestJS Swagger decorators

Installation

npm install @wisemen/nestjs-async-api

Usage

Define a Channel

Create channels using the createChannel function with type-safe address parameters:

import { createChannel } from '@wisemen/nestjs-async-api'

export const userNotificationsChannel = createChannel(
  'users.{userId}.notifications',
  {
    parameters: {
      userId: {
        description: 'The ID of the user receiving notifications'
      }
    },
    operations: {
      subscribe: {
        action: 'receive',
        summary: 'Subscribe to user notifications',
        description: 'Receive real-time notifications for a specific user',
        messages: [
            UserNotificationEvent // a DTO decorated with @nestjs/swagger properties
        ]
      }
    }
  }
)

Define Your AsyncAPI Specification

Create an AsyncAPI definition that points to your channel files:

import { AsyncAPIDefinition } from '@wisemen/nestjs-async-api'

export const asyncApiDefinition: AsyncAPIDefinition = {
  asyncapi: '3.0.0',
  defaultContentType: 'application/json',
  info: {
    title: 'My Application API',
    version: '1.0.0',
    description: 'Real-time event API for My Application',
    contact: {
      name: 'API Support',
      email: '[email protected]'
    }
  },
  channels: 'src/**/*.channel.ts'  // Glob pattern to find channel files
}

Generate YAML Documentation

Generate AsyncAPI YAML specification from your definitions:

import { generateAsyncApiYaml } from '@wisemen/nestjs-async-api'
import { asyncApiDefinition } from './async-api.definition'

const yaml = await generateAsyncApiYaml(asyncApiDefinition)
console.log(yaml)

Generate HTML Documentation

Generate beautiful HTML documentation from your YAML specification:

import { generateAsyncAPIHTML } from '@wisemen/nestjs-async-api'

await generateAsyncAPIHTML(
  yaml,                    // AsyncAPI YAML string
  './docs',                // Output directory
  'async-api.html'         // Output filename
)

Integration with NestJS

This package works seamlessly with NestJS decorators from @nestjs/swagger. Use @ApiProperty() decorators on your DTOs, and they will be automatically converted to AsyncAPI schemas:

import { ApiProperty } from '@nestjs/swagger'

export class UserNotificationEvent {
  @ApiProperty({ description: 'Notification ID' })
  id: string

  @ApiProperty({ description: 'Notification message' })
  message: string

  @ApiProperty({ description: 'Timestamp', type: Date })
  timestamp: Date
}

License

GPL