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

@texagon/nestjs-health

v0.0.1

Published

A comprehensive health monitoring package for NestJS applications with metrics and Kubernetes-ready health checks

Readme

NestJS Health Monitor

A comprehensive health monitoring package for NestJS applications with detailed metrics and Kubernetes-ready health checks.

Features

  • Kubernetes-Ready Health Checks: Includes liveness and readiness probes for container orchestration
  • Detailed System Metrics: Memory usage, CPU utilization, disk space, and system information
  • Request Tracking: Monitor HTTP requests, response times, and status codes
  • Historical Data: Track metrics over time with configurable history length
  • Swagger Documentation: Auto-generated API documentation for all endpoints
  • Flexible Configuration: Enable/disable specific monitoring features based on your needs
  • Security: Optional password protection for sensitive monitoring endpoints

Installation

Using the CLI (Recommended)

# Install globally
npm install -g @texagon/nestjs-health

# Run the installer in your NestJS project directory
texagon-nestjs-health install

This will guide you through an interactive setup process.

Manual Installation

# Install the package
npm install @texagon/nestjs-health

# Install required peer dependencies if you don't have them
npm install @nestjs/terminus @nestjs/axios

Then add to your app.module.ts:

import { HealthModule } from '@texagon/nestjs-health';

@Module({
  imports: [
    // ... other imports
    HealthModule.register({
      enableMemoryMonitoring: true,
      enableDiskMonitoring: true,
      diskPath: '/',
      diskThresholdPercent: 0.75,
      routePrefix: 'health',
    }),
  ],
})
export class AppModule {}

Available Endpoints

  • GET /health: General health check (returns 200 if healthy, 503 if unhealthy)
  • GET /health/live: Liveness probe for Kubernetes
  • GET /health/ready: Readiness probe for Kubernetes
  • GET /health/stats: Detailed system metrics and statistics

Note: If password protection is enabled, all endpoints require authentication using Bearer token authentication. Add the header Authorization: Bearer yourpassword to your requests.

Detailed Statistics

The /health/stats endpoint provides detailed information including:

  • Process Information: PID, uptime, memory usage
  • System Information: Platform, architecture, node version, system uptime, load average
  • Memory Usage: Current, minimum, and maximum memory usage
  • CPU Utilization: Current and historical CPU usage
  • Disk Information: Available disk space
  • Request Metrics: Total request count, average response time, request breakdown by method and status code

Add the ?includeHistory=true query parameter to include historical metrics data.

Configuration Options

When registering the module, you can customize its behavior:

HealthModule.register({
  // Enable/disable memory monitoring (heap and RSS)
  enableMemoryMonitoring: true,
  
  // Enable/disable disk space monitoring
  enableDiskMonitoring: true,
  
  // Path to monitor for disk space
  diskPath: '/',
  
  // Threshold percentage for disk space warning (0.75 = 75%)
  diskThresholdPercent: 0.75,
  
  // Route prefix for health endpoints
  routePrefix: 'health',
  
  // Enable password protection for health endpoints
  passwordProtected: false,
  
  // Password for accessing health endpoints (required if passwordProtected is true)
  password: 'your-secure-password',
});

Docker / Kubernetes Integration

Add these health checks to your container configuration:

HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
  CMD wget -q -O- http://localhost:3000/health/live || exit 1

For Kubernetes, add to your deployment:

livenessProbe:
  httpGet:
    path: /health/live
    port: 3000
  initialDelaySeconds: 15
  periodSeconds: 30
readinessProbe:
  httpGet:
    path: /health/ready
    port: 3000
  initialDelaySeconds: 5
  periodSeconds: 10

License

MIT