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

risk

v1.0.0

Published

A modernized, minimal Danger JS for GitHub

Readme

risk

A smaller Danger JS runtime with a narrower scope: GitHub only, ESM only, Node 22.18+. Three runtime dependencies.

Full documentation lives at danger.systems/js — the Dangerfile API is the same.

Installation

yarn add risk --dev

Usage

Create a dangerfile.ts in your project root. Your project does not need "type": "module" — Dangerfiles are always evaluated as ESM:

import { danger, warn, fail, message, markdown } from "risk"

if (!danger.github.pr.body.length) {
  fail("Please add a description to your PR.")
}

const bigPR = danger.github.pr.additions + danger.github.pr.deletions > 500
if (bigPR) {
  warn("This PR is quite large. Consider splitting it up.")
}

message(`This PR modifies ${danger.git.modified_files.length} file(s).`)

Existing Dangerfiles that import { danger } from "danger" will also work — a built-in ESM loader handles the redirect at runtime. To get TypeScript support for the "danger" import, add "risk" to the types array in your tsconfig.json:

{
  "compilerOptions": {
    "types": ["risk"]
  }
}

Plugins

danger-plugin-* packages work unchanged, including the CommonJS ones — the loader redirects their danger import (or require) to risk, and they share the same results, so warn() from inside a plugin lands in the Danger comment.

import { danger, warn } from "risk"
import jest from "danger-plugin-jest"

schedule(jest())

Commands

danger ci — Run on CI against the current pull request.

danger ci [options]

| Option | Description | | --- | --- | | -d, --dangerfile <path> | Path to Dangerfile (default: dangerfile.ts) | | --id <id> | Unique identifier for this run (default: "Danger") | | -t, --text-only | Print to stdout instead of posting comments | | --fail-on-errors | Exit with code 1 if there are failures | | --new-comment | Always create a new comment | | --remove-previous-comments | Remove previous Danger comments | | --base-url <url> | GitHub API base URL (for GitHub Enterprise) | | --no-publish-check | Don't set a commit status | | -v, --verbose | Verbose logging |

danger --version prints the installed version.

danger pr <url> — Test your Dangerfile against an existing PR without posting comments.

danger pr https://github.com/owner/repo/pull/123

GitHub Actions

- run: yarn danger ci
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

For other CI providers, set DANGER_GITHUB_API_TOKEN and either DANGER_PR_URL or DANGER_REPO_SLUG + DANGER_PR_ID.

GitHub Enterprise

Set --base-url or the DANGER_GITHUB_API_BASE_URL environment variable to your GHE API endpoint.

What's different from Danger JS

  • GitHub only — no GitLab or BitBucket support
  • ESM only — no CommonJS, no Babel transpilation
  • Node 22.18+ — uses native type stripping, fetch, parseArgs, styleText
  • Single process — no subprocess/runner model
  • No inline comments — fail/warn/message accept a file and line, but results are always rendered in the single Danger comment (as file#L12) rather than posted onto the diff
  • 3 runtime deps — @octokit/rest, parse-diff, picomatch

Releasing

# Update CHANGELOG.md with the new version, then:
yarn release <patch|minor|major>

This bumps package.json, commits, tags, and pushes. The publish workflow handles creating the GitHub release and publishing to npm.