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

@glubean/redaction

v0.1.11

Published

Scope-based secrets/PII detection and masking for [Glubean](https://glubean.dev).

Readme

@glubean/redaction

Scope-based secrets/PII detection and masking for Glubean.

Overview

Redaction v2 uses a data-driven scope model. Scopes declare what to redact (event type + field path + rules). Handlers declare how to interpret payloads (JSON, headers, URL query strings). Plugins provide detection logic (sensitive keys, value patterns).

All scope declarations — built-in HTTP, gRPC, or any future protocol — use the same shape. No hardcoded protocol knowledge in the redaction package.

Quick Start

import {
  compileScopes,
  redactEvent,
  BUILTIN_SCOPES,
  DEFAULT_GLOBAL_RULES,
} from "@glubean/redaction";

// Compile scopes once at startup
const scopes = compileScopes({
  builtinScopes: BUILTIN_SCOPES,
  globalRules: DEFAULT_GLOBAL_RULES,
  replacementFormat: "partial",
});

// Redact events
const event = {
  type: "trace",
  data: {
    requestHeaders: { authorization: "Bearer secret-token" },
    requestBody: { password: "hunter2", username: "alice" },
  },
};

const redacted = redactEvent(event, scopes, "partial");
// redacted.data.requestHeaders.authorization → "Bea***123"
// redacted.data.requestBody.password → "hun***er2"
// redacted.data.requestBody.username → "alice" (not sensitive)

Architecture

scope declarations (built-in + plugins + user overrides)
  → compile to CompiledScope[]
    → redactEvent(event, compiledScopes)
      → for each matching scope:
        1. extract target value via field path
        2. run the scope's handler
        3. handler calls engine with per-scope plugin pipeline
        4. write redacted value back

Scopes

A scope declares where to redact and what rules apply:

{
  id: "http.request.headers",
  name: "HTTP request headers",
  event: "trace",
  target: "data.requestHeaders",
  handler: "headers",
  rules: {
    sensitiveKeys: ["authorization", "cookie"],
  },
}
  • id — stable config key for user overrides
  • event — which event type to match
  • target — dot-path to the payload field
  • handler — which handler interprets the payload
  • rules — scope-specific sensitive keys and patterns

Handlers

Built-in handlers:

| Handler | Purpose | |---------|---------| | json | Recursive JSON object/array walker | | raw-string | Value-pattern matching on plain strings | | url-query | Parse URL, redact query params, serialize back | | headers | Header map with cookie/set-cookie parsing |

Plugins

Detection plugins (unchanged from v1):

  • sensitive-keys — key-level substring matching
  • jwt — JWT token detection
  • bearer — Bearer token detection
  • awsKeys — AWS access key ID
  • githubTokens — GitHub PAT tokens
  • email — Email address detection
  • ipAddress — IPv4 address detection
  • creditCard — Credit card number detection
  • hexKeys — Hex key detection (32+ chars)

Plugin Integration

Plugins declare their own redaction scopes via PluginFactory.redaction:

// gRPC plugin
grpc({
  proto: "./protos/users.proto",
  address: "{{ADDR}}",
  package: "acme.users.v1",
  service: "UsersService",
});

// Plugin internally declares:
// redaction: [
//   { id: "grpc.metadata", handler: "headers", rules: { sensitiveKeys: ["authorization"] } },
//   { id: "grpc.request",  handler: "json" },
//   { id: "grpc.response", handler: "json" },
// ]

The runner collects all plugin declarations and merges them with built-in scopes at compile time.

User Overrides

Users override scopes by stable id in .glubean/redact.json:

{
  "scopes": {
    "grpc.metadata": { "enabled": false },
    "http.request.headers": {
      "rules": { "sensitiveKeys": ["x-custom-secret"] }
    }
  },
  "globalRules": {
    "sensitiveKeys": ["my-internal-key"],
    "customPatterns": [
      { "name": "internal-id", "regex": "INT-[A-Z0-9]{8}" }
    ]
  }
}

Replacement Formats

| Format | Example | |--------|---------| | simple | [REDACTED] | | labeled | [REDACTED:sensitive-keys] | | partial | Bea***123 (smart masking) |

License

MIT