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

@xiaopin44/sec-command-warning

v1.0.0

Published

Detect dangerous shell commands (rm -rf, DROP TABLE, git force push, etc.) before they execute. CLI tool for CI/CD and development security.

Readme

sec-command-warning 🛡️

Detect dangerous shell commands before they execute.

Inspired by Claude Code's built-in destructive command detection. Catches rm -rf, DROP TABLE, git push --force, and 15+ other dangerous patterns.

Quick Start

npx sec-command-warning "git push --force"
# ⚠️  ⚠️  ⚠️  DANGEROUS COMMAND DETECTED
#    Warning: 可能覆盖远程历史

npx sec-command-warning "npm install"
# ✅ Command looks safe

Install

npm install -g @xiaodi/sec-command-warning
# or
npm install --save-dev @xiaodi/sec-command-warning

Usage

CLI

# Basic check
sec-warn "rm -rf ./node_modules"
sec-command-warning "DROP TABLE users"

# JSON output
sec-warn --json "git push --force"

# Read from stdin
echo "rm -rf /" | sec-warn --stdin

# Interpret exit codes
sec-warn --exit "grep foo file.txt" 1
# ℹ️  无匹配

API (Node.js)

import { checkWarning, interpretExit } from 'sec-command-warning'

// Check a command
console.log(checkWarning('rm -rf /'))
// { warning: '可能递归强制删除文件', severity: 'medium' }

// Interpret exit code
console.log(interpretExit('grep foo file.txt', 1))
// { isError: false, message: '无匹配' }

Detected Patterns (18)

| Category | Patterns | |----------|----------| | Git | reset --hard, push --force, clean -f, checkout ., restore ., stash drop/clear, branch -D, --no-verify, --amend | | Files | rm -rf, rm -r, rm -f | | Database | DROP TABLE/DATABASE/SCHEMA, DELETE FROM (full table) | | Infra | kubectl delete, terraform destroy, docker rm/system prune | | Access | chmod -R 0000 |

Exit Codes

| Code | Meaning | |------|---------| | 0 | Safe command | | 1 | Dangerous pattern detected | | 2 | Usage error |

CI/CD Integration

# GitHub Actions example
- name: Check for dangerous commands in PR
  run: |
    git diff main...HEAD | grep '^+' | sed 's/^+//' | npx sec-command-warning --stdin

License

MIT