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

@ciscode/audit-kit

v0.0.1

Published

A NestJS module for auditing and logging changes to entities using Zod schemas.

Readme

@ciscode/audit-kit

AuditKit is a reusable NestJS module for immutable audit logging with clean architecture (core / infra / nest).

It provides:

  • Framework-free core service (AuditService)
  • Pluggable repositories (MongoDB, in-memory)
  • Automatic change detection
  • Configurable redaction, idempotency, and retention policies
  • Cursor-based pagination for stable listing
  • Observability hooks (OpenTelemetry-friendly observer port)
  • Event streaming hooks (publisher port + default EventEmitter adapter)

Quality Gate Status npm version License: MIT TypeScript

Install

npm install @ciscode/audit-kit

Peer dependencies are managed by consuming applications.

Quick Start

import { Module } from "@nestjs/common";
import { AuditKitModule } from "@ciscode/audit-kit";

@Module({
  imports: [
    AuditKitModule.register({
      repository: {
        type: "in-memory",
      },
      redaction: {
        enabled: true,
        fields: ["actor.email", "metadata.password"],
        mask: "[REDACTED]",
      },
      idempotency: {
        enabled: true,
        keyStrategy: "idempotencyKey",
      },
    }),
  ],
})
export class AppModule {}

Usage

import { Injectable } from "@nestjs/common";
import { ActorType, AuditActionType, AuditService } from "@ciscode/audit-kit";

@Injectable()
export class UserService {
  constructor(private readonly auditService: AuditService) {}

  async updateUser(): Promise<void> {
    await this.auditService.log({
      actor: { id: "user-1", type: ActorType.USER, email: "[email protected]" },
      action: AuditActionType.UPDATE,
      resource: { type: "user", id: "user-1" },
      metadata: { reason: "profile update" },
      idempotencyKey: "req-123",
    });
  }
}

Advanced Features

Cursor Pagination

const page1 = await auditService.queryWithCursor({ actorId: "user-1" }, { limit: 20 });

if (page1.hasMore) {
  const page2 = await auditService.queryWithCursor(
    { actorId: "user-1" },
    { limit: 20, cursor: page1.nextCursor },
  );
}

Observability Hooks

Provide an observer to emit metrics/spans/log events (for OpenTelemetry, Prometheus, etc.):

AuditKitModule.register({
  repository: { type: "in-memory" },
  observer: {
    onEvent(event) {
      // event.operation, event.durationMs, event.success
      console.log(event);
    },
  },
});

Event Streaming

Emit domain events after successful audit creation:

AuditKitModule.register({
  repository: { type: "in-memory" },
  eventStreaming: {
    enabled: true,
    // optional custom publisher; default is EventEmitter adapter
    publisher: {
      publish(event) {
        console.log(event.type, event.payload.id);
      },
    },
  },
});

Tooling

  • Tests: npm test
  • Typecheck: npm run typecheck
  • Lint: npm run lint
  • Build: npm run build
  • Mutation testing: npm run mutation
  • Benchmarks: npm run bench

CI Compatibility Matrix

PR validation runs on a matrix to catch environment regressions early:

  • Node.js: 20, 22
  • OS: ubuntu-latest, windows-latest

See .github/workflows/pr-validation.yml.

Release Flow (Summary)

  1. Work on a feature branch from develop
  2. Add a changeset for user-facing changes: npx changeset
  3. Merge into develop
  4. Automation opens "Version Packages" PR into master
  5. Merge and publish

See docs/RELEASE.md for details.