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

@webeach/dist-guard

v0.2.0

Published

Blazing fast CLI to scan your compiled code (dist) for leaked tokens, API keys, and other secrets before deploying.

Readme


💎 Особенности

  • 🚀 Высокая скорость — сканирует тысячи файлов за миллисекунды
  • 🧠 Минимум ложных срабатываний — умный анализ контекста отличает реальные секреты от случайных хэшей в коде
  • 🛡️ Защита от >50 типов утечек — токены SaaS, ключи Cloud провайдеров, SSH/RSA ключи, строки подключения к БД
  • 🙈 Автоматическая маскировка — скрывает содержимое найденных токенов, чтобы не скомпрометировать их в логах CI/CD
  • 💻 Детект локальных путей — предотвращает утечку имен пользователей ОС и структуры директорий разработчика
  • 📦 Zero Config — работает прямо из коробки без дополнительных настроек

📦 Установка

Для использования в проектах (в CI/CD или npm scripts) рекомендуется устанавливать локально:

npm install -D @webeach/dist-guard

или

pnpm add -D @webeach/dist-guard

или

yarn add -D @webeach/dist-guard

🚀 Быстрый старт

Сканировать директорию dist без установки:

npx @webeach/dist-guard

или

pnpm dlx @webeach/dist-guard

или

yarn dlx @webeach/dist-guard

🛠 Конфигурация

CLI Флаги

| Флаг | Алиас | Описание | По умолчанию | | ------------------------ | ----- | ----------------------------------------------------- | --------------------- | | --include <globs> | -i | Glob-паттерны файлов для сканирования (через запятую) | {dist,build}/**/*.* | | --exclude <globs> | -x | Glob-паттерны файлов для исключения (через запятую) | — | | --ignore-rules <rules> | -r | Ключи правил для игнорирования (через запятую) | — | | --no-redact | — | Показывать секреты без маскировки | — |

Пример:

npx @webeach/dist-guard -i "out/**/*.*" -r GitHubToken --no-redact

Файл конфигурации

dist-guard автоматически ищет настройки в package.json (в поле distGuard) или в файле dist-guard.config.json в корне проекта.

Вариант 1: В package.json

{
  "name": "my-project",
  "distGuard": {
    "include": ["{dist,build}/**/*.*"],
    "exclude": ["**/*.map", "vendor/**"],
    "ignoreRules": ["GenericAPIKey"],
    "redact": false
  }
}

Вариант 2: В dist-guard.config.json

{
  "$schema": "https://schemas.webea.ch/dist-guard/v0.2.json",
  "include": ["{dist,build}/**/*.*"],
  "exclude": ["**/*.map", "vendor/**"],
  "ignoreRules": ["GenericAPIKey"],
  "redact": false
}

📥 Примеры использования

В npm scripts

Добавьте сканирование в ваш процесс сборки, чтобы предотвратить деплой секретов. Если dist-guard найдет утечку, он завершится с кодом 1 и прервёт выполнение скрипта.

{
  "scripts": {
    "build": "vite build",
    "scan": "dist-guard",
    "release": "npm run build && npm run scan && npm run deploy"
  }
}

В GitHub Actions

name: Build and Scan
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: pnpm

      - name: Install dependencies
        run: pnpm install

      - name: Build project
        run: pnpm run build

      - name: Security Scan
        run: pnpm dist-guard

🧩 Зависимости

В проекте используется ripgrep — один из самых быстрых в мире поисковых движков, написанный на Rust. Для парсинга аргументов командной строки применяется легковесный cac.


👨‍💻 Автор

Разработка и поддержка: Руслан Мартынов

Если у тебя есть предложения или найден баг, открывай issue или отправляй pull request.


📄 Лицензия

Этот пакет распространяется под лицензией MIT.