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

@tsdevstack/nest-common

v0.1.7

Published

Shared NestJS modules for tsdevstack microservices — auth, rate limiting, secrets, observability, and more

Readme

@tsdevstack/nest-common

Shared NestJS modules for tsdevstack microservices. Provides auth, rate limiting, secrets management, observability, notifications, database connectivity, and application bootstrap — so every service starts with production-ready infrastructure.

Features

  • Authentication — Kong JWT validation guard with public/partner route decorators
  • Rate Limiting — Redis-backed rate limiting with per-route configuration
  • Email Rate Limiting — Dedicated rate limiter for email-sending endpoints
  • Secrets Management — Multi-provider secrets (GCP Secret Manager, AWS Secrets Manager, Azure Key Vault)
  • Observability — Logging (Pino), metrics (Prometheus/OpenTelemetry), tracing (OTLP), health checks
  • Database — Prisma connection pooling with pg adapter and SSL support
  • Notifications — Email (Resend), SMS, and push notification service
  • Background Jobs — BullMQ configuration and scheduler guard
  • Service Client — Type-safe HTTP client for inter-service communication
  • BootstrapstartApp() and startWorker() for consistent app initialization

Installation

npm install @tsdevstack/nest-common

Quick Start

Bootstrap a service

import { startApp } from '@tsdevstack/nest-common';
import { AppModule } from './app.module';

startApp(AppModule, {
  serviceName: 'my-service',
  port: 3000,
});

Import modules

import {
  AuthModule,
  RedisModule,
  RateLimitModule,
  ObservabilityModule,
  SecretsModule,
} from '@tsdevstack/nest-common';

@Module({
  imports: [
    ObservabilityModule.register({ serviceName: 'my-service' }),
    SecretsModule,
    AuthModule,
    RedisModule,
    RateLimitModule,
  ],
})
export class AppModule {}

Protect routes

import { AuthGuard, Public, RateLimit } from '@tsdevstack/nest-common';

@Controller('users')
@UseGuards(AuthGuard)
export class UsersController {
  @Public()
  @Get('health')
  health() {
    return { status: 'ok' };
  }

  @RateLimit({ points: 10, duration: 60 })
  @Get('profile')
  getProfile(@Req() req: AuthenticatedRequest) {
    return req.user;
  }
}

Modules

| Module | Description | |--------|-------------| | AuthModule | Kong JWT validation, @Public() and @PartnerApi() decorators | | RedisModule | Redis connection with retry and health checks | | RateLimitModule | Redis-backed rate limiting with @RateLimit() decorator | | EmailRateLimitModule | Dedicated email rate limiting | | SecretsModule | Multi-cloud secrets loading (GCP, AWS, Azure) | | ObservabilityModule | Logging, metrics, tracing, and health endpoints | | NotificationModule | Email (Resend), SMS, and push notifications | | BullConfigModule | BullMQ queue configuration |

Utilities

| Export | Description | |--------|-------------| | startApp() | Bootstrap a NestJS application with standard middleware | | startWorker() | Bootstrap a background worker process | | createPrismaConnection() | Prisma client with pg adapter and SSL | | BaseServiceClient | HTTP client for service-to-service calls | | filterForwardHeaders() | Header filtering for inter-service requests | | generateSwaggerDocs() | OpenAPI documentation setup | | LoggerService | Pino-based structured logging | | MetricsService | Custom Prometheus metrics |

License

MIT