package-checker.sh can fetch package.json files from GitHub organizations or single repositories, then run the vulnerability check against them.
- Network access to
api.github.com - (Recommended) A GitHub personal access token (PAT) for higher rate limits and private repositories
You can pass the token explicitly with --github-token or via the GITHUB_TOKEN environment variable.
Scan all repositories in an organization and immediately check them against your vulnerability database:
GITHUB_TOKEN="$GITHUB_TOKEN" package-checker \
--github-org my-org \
--source ./my-vulns.jsonOr, passing the token as a flag:
package-checker \
--github-org my-org \
--github-token "$GITHUB_TOKEN" \
--source ./my-vulns.jsonpackage-checker \
--github-repo owner/repo \
--github-token "$GITHUB_TOKEN" \
--source ./my-vulns.jsonFor public repositories you may omit the token, but requests will be rate limited by GitHub.
Sometimes you only want to download package.json files and inspect them locally or run several tools on them.
package-checker \
--github-org my-org \
--github-only \
--github-output ./my-packagesThis will:
- List repositories in
my-org - Fetch their
package.jsonfiles - Write them under
./my-packages - Skip the vulnerability scan step
You can put default GitHub settings in .package-checker.config.json:
{
"github": {
"org": "my-org",
"token": "",
"output": "./packages"
}
}Then run:
package-checker --config .package-checker.config.json --source ./my-vulns.jsonCommand-line flags still override config values. See Configuration for more details.
You can automatically create GitHub issues for repositories with vulnerabilities. Two modes are available:
Use --create-multiple-issues to create one issue per vulnerable package:
package-checker \
--github-org my-org \
--github-token "$GITHUB_TOKEN" \
--source ./my-vulns.json \
--create-multiple-issuesUse --create-single-issue to create one issue containing all vulnerabilities:
package-checker \
--github-repo owner/repo \
--github-token "$GITHUB_TOKEN" \
--source ./my-vulns.json \
--create-single-issue| Flag | Issues Created | Best For |
|---|---|---|
--create-multiple-issues |
One per vulnerable package | Tracking individual package updates |
--create-single-issue |
One consolidated report | Overview of all security issues |
Both modes include:
- Severity levels with visual indicators (🔴 Critical, 🟠 High, 🟡 Medium, 🟢 Low)
- Links to GHSA advisories and CVE details
- Affected files and versions
- Recommendations for remediation
- Automatic labeling with
security,vulnerabilityanddependenciestags
Note: Both flags require a GitHub token with repo scope to create issues.
You can combine direct package lookup with GitHub organization scanning to find where a specific package is used:
# Find all repositories using a specific package version
package-checker \
--github-org my-org \
--github-token "$GITHUB_TOKEN" \
--package-name next \
--package-version 16.0.3
# Find all repositories using any version of a package
package-checker \
--github-org my-org \
--github-token "$GITHUB_TOKEN" \
--package-name lodash
# Find repositories with packages in a version range
package-checker \
--github-org my-org \
--github-token "$GITHUB_TOKEN" \
--package-name express \
--package-version '^4.17.0'This is useful for:
- Incident response: "Which repos use the vulnerable version?"
- Upgrade planning: "Where do we need to update this package?"
- Dependency auditing: "Is anyone still using this deprecated package?"