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

@cerberauth/gha-reportx

v0.0.0

Published

Shared reportx CLI flag and PR-comment helpers for CerberAuth's reportx-based GitHub Actions

Readme

@cerberauth/gha-reportx

Shared reportx CLI flag and PR-comment helpers for CerberAuth's reportx-based GitHub Action wrappers (jwtop-action today, others later), so the PR-comment summary and --output/--report-url flag wiring aren't reimplemented per repository.

Installation

npm install @cerberauth/gha-reportx

This package has @actions/core and @actions/github as peer dependencies — install whichever versions your action already depends on.

API

Flags (src/flags.ts)

Helpers for reportx's own CLI flags (--output, --output-format, --report-url, --report-format, --report-header, --show-all-findings, --no-color, --quiet), so actions can expose first-class inputs for them without hand-crafting a raw args input.

  • hasFlag(args: string[], flag: string): boolean — whether flag (as --flag or --flag=value) is already present in args.
  • parseFormatFlag(args: string[]): string | undefined — reads a --format flag's value out of args.
  • parseOutputFlags(args: string[]): { path?: string; format?: string } — reads --output and --output-format out of args.
  • tempReportPath(format: string): string — a temp file path (under RUNNER_TEMP, falling back to the OS temp dir) with the extension reportx uses for the given --output-format value.
  • appendReportxFlags(commandArgs: string[]): void — reads the standard reportx-related action inputs (output-format, output-path, report-url, report-format, report-headers, show-all-findings, no-color, quiet) via @actions/core's getInput and appends the matching CLI flags to commandArgs, unless already present.

Comments (src/comment.ts)

Helpers for turning a reportx JSON report (see format/json.go and finding.go for the schema) into a PR comment.

  • isPullRequestEvent(): boolean — whether the current workflow run was triggered by a pull_request or pull_request_target event with a pull request in the payload.
  • workflowRunUrl(): string — a link to the current workflow run, used as a fallback when the full findings summary doesn't fit in a PR comment.
  • buildCommentBody(reportJson: string, options: { toolName: string; docsUrl: string }): string — builds a comment body listing every finding with its severity and URL. Falls back to a per-severity count table plus a link to the workflow run when the full summary would exceed GitHub's comment size limit. toolName and docsUrl are used in the heading, footer, and to scope the marker used to find/update this comment on future runs (so different tools commenting on the same PR don't clobber each other's comments).
  • postScanComment(token: string, body: string): Promise<void> — creates or updates the PR comment carrying body (identified by the marker on its first line, as produced by buildCommentBody). No-ops outside of pull requests. Logs a warning instead of throwing on failure (e.g. a token without pull-requests: write on pull requests from forks), since commenting is a best-effort convenience on top of the scan.

Example

import { getInput } from '@actions/core'
import {
  appendReportxFlags,
  buildCommentBody,
  isPullRequestEvent,
  postScanComment
} from '@cerberauth/gha-reportx'
import { readFileSync } from 'fs'

const args = ['scan']
appendReportxFlags(args)

// ... run the tool with `args`, writing a reportx JSON report to some path ...

if (isPullRequestEvent()) {
  const reportJson = readFileSync('report.json', 'utf8')
  const body = buildCommentBody(reportJson, {
    toolName: 'my-tool',
    docsUrl: 'https://www.cerberauth.com/docs/my-tool/'
  })
  await postScanComment(getInput('github-token'), body)
}