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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@logvault/eslint-plugin

v0.2.4

Published

ESLint plugin for audit gap detection - Shift-Left Compliance

Readme

@logvault/eslint-plugin

ESLint plugin for Shift-Left Compliance - detect audit logging gaps during development, not during audits.

npm version License: MIT

Installation

npm install @logvault/eslint-plugin --save-dev
# or
pnpm add -D @logvault/eslint-plugin

Usage (ESLint v9 Flat Config)

// eslint.config.js
import logvault from "@logvault/eslint-plugin";

export default [
  logvault.configs.recommended,
  // or logvault.configs.strict for stricter enforcement
];

Custom Configuration

// eslint.config.js
import logvault from "@logvault/eslint-plugin";

export default [
  {
    plugins: {
      logvault,
    },
    rules: {
      "logvault/require-audit-in-catch": ["warn", {
        allowConsoleError: false,
        auditFunctions: ["client.log", "logger.audit"],
      }],
      "logvault/require-audit-in-mutations": ["warn", {
        methods: ["DELETE", "PUT", "POST", "PATCH"],
        ignorePaths: ["**/health/**"],
      }],
      "logvault/no-pii-in-logs": ["error", {
        piiFields: ["email", "phone", "ssn"],
        transformers: ["hashedEmail", "maskedString"],
      }],
    },
  },
];

Rules

logvault/require-audit-in-catch

Ensures catch blocks include audit logging for compliance tracking.

Bad:

try {
  await db.user.delete(id);
} catch (error) {
  console.error(error); // No audit trail!
}

Good:

try {
  await db.user.delete(id);
} catch (error) {
  await client.log({ action: 'user.delete.failed', error });
  throw error;
}

Options:

  • allowConsoleError (boolean, default: false) - Allow console.error as substitute
  • auditFunctions (string[], default: ["client.log", "logvault.log", "audit.log"])

logvault/require-audit-in-mutations

Ensures mutation handlers (DELETE, PUT, POST, PATCH) include audit logging.

Bad:

export async function DELETE(req) {
  await db.user.delete(id);
  return Response.json({ success: true });
}

Good:

export async function DELETE(req) {
  await client.log({ action: 'user.deleted', userId: id });
  await db.user.delete(id);
  return Response.json({ success: true });
}

Options:

  • methods (string[], default: ["DELETE", "PUT", "POST", "PATCH"])
  • auditFunctions (string[], default: ["client.log", "logvault.log", "audit.log"])
  • ignorePaths (string[], default: []) - Glob patterns to ignore

logvault/no-pii-in-logs

Prevents logging PII fields directly without transformation.

Bad:

await client.log({
  action: 'user.created',
  metadata: { email: user.email } // PII exposed!
});

Good:

import { hashedEmail } from '@logvault/schemas';

await client.log({
  action: 'user.created',
  metadata: { email: hashedEmail.parse(user.email) }
});

Options:

  • piiFields (string[]) - Fields to detect as PII
  • transformers (string[]) - Functions that safely transform PII
  • auditFunctions (string[])

Presets

| Preset | Description | |--------|-------------| | recommended | Warns on missing audits, errors on PII | | strict | Errors on all violations |

Integration with @logvault/schemas

This plugin works seamlessly with @logvault/schemas for:

  • PII-safe transformers (hashedEmail, maskedString, anonymizedIp)
  • Type-safe event schemas
  • Validation at development time

Why Shift-Left Compliance?

Traditional compliance audits find issues after deployment. This plugin catches audit gaps during development:

  • ⏱️ Earlier detection - Find issues in your IDE, not in audits
  • 💰 Lower cost - Fix problems before they reach production
  • 🔒 Better security - PII protection enforced by tooling
  • Audit readiness - Be confident your logging is complete

License

MIT © LogVault