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

@scanwright/cli-testing

v0.1.1

Published

Scanwright CLI (test environment) — security scanning for developers and CI

Readme

@scanwright/cli

Scanwright CLI — 面向开发者和 CI 的安全扫描命令行工具。

安装

pnpm install
pnpm --filter @scanwright/cli build

构建后可通过 node cli/dist/index.js 或 link 后直接使用 scanwright 命令。

认证

# 交互式配置
scanwright auth login --api-key csa_your_key_here

# 或使用环境变量(推荐 CI 场景)
export SCANWRIGHT_API_KEY=csa_your_key_here
export SCANWRIGHT_API_URL=https://api.scanwright.dev  # 可选

凭证存储在 ~/.config/scanwright/credentials.json(权限 0600)。

优先级:--api-key flag > SCANWRIGHT_API_KEY 环境变量 > 配置文件。

命令

scan diff

扫描 git diff 中的安全问题:

# 从 git 生成 diff
scanwright scan diff --base-ref main

# 从 stdin 读取 diff
git diff main...HEAD | scanwright scan diff

scan files

扫描本地文件:

scanwright scan files src/auth.ts src/db.ts

scan status

查询扫描状态:

scanwright scan status scan_abc123

scan findings

获取扫描结果:

scanwright scan findings scan_abc123

CI 集成

使用 --json 输出 JSON 格式,配合退出码实现流水线阻断:

# 有 high 及以上 severity 的 finding 时退出码为 1
scanwright scan diff --base-ref main --json --fail-severity high

# 仅在 critical 时失败
scanwright scan diff --base-ref main --json --fail-severity critical

全局选项

| 选项 | 说明 | |------|------| | --json | JSON 格式输出 | | --api-key <key> | 覆盖 API key | | --api-url <url> | 覆盖 API base URL | | --version | 显示版本 |

scan 子命令通用选项

| 选项 | 说明 | 默认值 | |------|------|--------| | --scan-depth | 扫描深度:quick, standard, deep | standard | | --max-credits | 最大 credit 消耗 | 无限制 | | --no-wait | 不等待结果,立即返回 scan_id | 等待 | | --fail-severity | 触发非零退出码的最低严重级别 | high |

限制

  • diff 和 files payload 上限 5 MB。超出时请使用 --scan-depth quick 或缩小范围。
  • API key 不会写入日志或标准输出。