{"_id":"risk","_rev":"13-69e1a5fdbe46bfc674c157011d38d3f8","name":"risk","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"risk","version":"0.0.0","keywords":["risk","probability","dice","board game"],"author":{"name":"brainss"},"license":"MIT","_id":"risk@0.0.0","maintainers":[{"name":"brainss","email":"brian.a.hassinger@gmail.com"}],"bin":{"risk":"./cli.js"},"dist":{"shasum":"1cc782a07dd22ac896b87293051b9fd9125861c9","tarball":"https://registry.npmjs.org/risk/-/risk-0.0.0.tgz","integrity":"sha512-tVxvh6fEPmlHYiovfBLkhjZAoZiYXrA4oXO9Z3hX4Fdo5qx69JHW2vSIEGzXhNmFmStqVCnDToRXy77/hgzuCA==","signatures":[{"sig":"MEYCIQDR3MDN6AqMmfxl+0nAdf9GIIs4pPDrJMpydOfc82/fVAIhAO+/WLp6ExL06d5SA1RFfkIOxd/pGU7Tka4NrtvUkYdg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"risk.js","gitHead":"7f5aab7039552fda13e281cdcfc92011133133c7","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"brainss","email":"brian.a.hassinger@gmail.com"},"repository":{"url":"git://github.com/brainss/risk.git","type":"git"},"_npmVersion":"1.2.0","description":"Probability calculator for the board game risk","directories":{"test":"test"},"dependencies":{},"readmeFilename":"README.md","devDependencies":{}},"0.0.2":{"name":"risk","version":"0.0.2","keywords":["danger","code-review","github","pull-request","ci","linting"],"author":{"name":"Orta Therox","email":"orta.therox@gmail.com"},"license":"MIT","_id":"risk@0.0.2","maintainers":[{"name":"brainss","email":"brian.a.hassinger@gmail.com"},{"name":"orta","email":"orta.therox@gmail.com"}],"homepage":"https://github.com/danger/risk#readme","bugs":{"url":"https://github.com/danger/risk/issues"},"bin":{"danger":"dist/cli/danger.js"},"dist":{"shasum":"dc98290b175d7869ca1d70235bbbc79ab6030fe0","tarball":"https://registry.npmjs.org/risk/-/risk-0.0.2.tgz","fileCount":102,"integrity":"sha512-KBEjGj9LipiA3GnSglpXOM0SI14Pwq3cVt+z8vFIvajRtOS1dOeUi7s3AAlgc5ZwdK3RovisUeUl+hvx8byikg==","signatures":[{"sig":"MEUCIQCYIDC/0WLyqdLboOLl5jW7dxpazSGFYJfhUhn6b8AaegIgSKgD1YDB6ZwnDKOLexKJHTOss32j64d82lzv7oChaKw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":175858},"type":"module","engines":{"node":">=22.6.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"99b254d027fb392dd613cf15610e73d9b6f4d5ec","scripts":{"test":"vitest run","build":"tsc","release":"node --experimental-strip-types scripts/release.ts","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"orta","email":"orta.therox@gmail.com"},"repository":{"url":"git+https://github.com/danger/risk.git","type":"git"},"_npmVersion":"11.6.0","description":"A modernized, minimal Danger JS for GitHub","directories":{},"_nodeVersion":"24.9.0","dependencies":{"picomatch":"^4.0.2","parse-diff":"^0.11.1","@octokit/rest":"^21.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.5","typescript":"^5.7.3","@types/node":"^22.0.0","@types/picomatch":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/risk_0.0.2_1771687633416_0.9464414309170022","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"risk","version":"0.0.3","keywords":["danger","code-review","github","pull-request","ci","linting"],"author":"Orta Therox <orta.therox@gmail.com>","license":"MIT","_id":"risk@0.0.3","maintainers":[{"name":"orta","email":"orta.therox@gmail.com"}],"homepage":"https://github.com/danger/risk#readme","bugs":{"url":"https://github.com/danger/risk/issues"},"bin":{"danger":"./dist/cli/danger.js"},"dist":{"shasum":"3f1b5de106d4279a8dff3ea0325be72ecbb7dd4c","tarball":"https://registry.npmjs.org/risk/-/risk-0.0.3.tgz","fileCount":103,"integrity":"sha512-0rVdtOtizxvFIbMFo96aOxsd2Ih7V0w1AkNpdUYbP9a3IXjOIwfi+fXE9Yz4IbNzsw5++y9ETZbGTMZBad5/bg==","signatures":[{"sig":"MEUCIQClLk9811KV1KwjArzOzZcyPAa/H7Yz7g4vNOlxoMIJLgIgMrM6OPiJc7ToNfbnv2GvCxfngRx6q/ySj5TQuaDqYS0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":178475},"type":"module","engines":{"node":">=22.6.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ed30cb6445c2d830208eefcb3274e3c0e3a4b34b","scripts":{"test":"vitest run","build":"tsc","release":"node --experimental-strip-types scripts/release.ts","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:161c8a8e-9d94-4789-81d1-68cc9b680bbc"}},"repository":{"url":"https://github.com/danger/risk.git","type":"git"},"description":"A modernized, minimal Danger JS for GitHub","directories":{},"dependencies":{"picomatch":"^4.0.2","parse-diff":"^0.11.1","@octokit/rest":"^21.1.1"},"_hasShrinkwrap":false,"packageManager":"yarn@4.12.0","devDependencies":{"vitest":"^3.0.5","typescript":"^5.7.3","@types/node":"^22.0.0","@types/picomatch":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/risk_0.0.3_1771688590916_0.9425043074422097","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"risk","version":"0.0.4","keywords":["danger","code-review","github","pull-request","ci","linting"],"author":"Orta Therox <orta.therox@gmail.com>","license":"MIT","_id":"risk@0.0.4","maintainers":[{"name":"orta","email":"orta.therox@gmail.com"}],"homepage":"https://github.com/danger/risk#readme","bugs":{"url":"https://github.com/danger/risk/issues"},"bin":{"danger":"./dist/cli/danger.js"},"dist":{"shasum":"fc2bf045d471ae378f78b1dc5dc3f240fd484cde","tarball":"https://registry.npmjs.org/risk/-/risk-0.0.4.tgz","fileCount":105,"integrity":"sha512-j8HLU/SKNLb3VDlzcLIXbFMqBxyEr0Gk3s7kh2pvUnTLTt7VW4CPS+YMVcNC+N3autqtEp3yZ8I+ffHMnGsKLA==","signatures":[{"sig":"MEYCIQDQkJ9OqCjR2ygNCxkXSnVNhRLyLGWBUevxW/ERq9EbCQIhAMdva62G+t1HB+uNqXvA7S0GzFZmYd//qQGPkCcdLwuk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":179178},"type":"module","engines":{"node":">=22.6.0"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.js"}},"gitHead":"9fab7466e341d38980da3f3879122abf8987dfdc","scripts":{"test":"vitest run","build":"tsc","release":"node --experimental-strip-types scripts/release.ts","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:161c8a8e-9d94-4789-81d1-68cc9b680bbc"}},"repository":{"url":"https://github.com/danger/risk.git","type":"git"},"description":"A modernized, minimal Danger JS for GitHub","directories":{},"dependencies":{"picomatch":"^4.0.2","parse-diff":"^0.11.1","@octokit/rest":"^21.1.1"},"_hasShrinkwrap":false,"packageManager":"yarn@4.12.0","devDependencies":{"vitest":"^3.0.5","typescript":"^5.7.3","@types/node":"^22.0.0","@types/picomatch":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/risk_0.0.4_1771762170954_0.538289010960185","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"risk","version":"0.0.5","keywords":["danger","code-review","github","pull-request","ci","linting"],"author":"Orta Therox <orta.therox@gmail.com>","license":"MIT","_id":"risk@0.0.5","maintainers":[{"name":"orta","email":"orta.therox@gmail.com"}],"homepage":"https://github.com/danger/risk#readme","bugs":{"url":"https://github.com/danger/risk/issues"},"bin":{"danger":"./dist/cli/danger.js"},"dist":{"shasum":"7329de5c3cd5cf2497d4e951d7f4707f9cc80275","tarball":"https://registry.npmjs.org/risk/-/risk-0.0.5.tgz","fileCount":105,"integrity":"sha512-zioW0VyRnnpWXvY9fCYj2ddAK1EerMLLfstSH30raX3OCp7h5mQxrSxifcRibGHqH1g3admmPhO2QCeKH4WWHg==","signatures":[{"sig":"MEUCIQCV7LE5cZOiDu5ooYXOLXNNGzqKXDGqj/jyPhhPLPk2ZAIgY0XfiwosIott6gYeDPYktkD7VgbMigIs/kF0ToswXF0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":179236},"type":"module","engines":{"node":">=22.6.0"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.js"}},"gitHead":"a199d7e042eac7b24f963b9b75a58d39b5c4a766","scripts":{"test":"vitest run","build":"tsc","release":"node --experimental-strip-types scripts/release.ts","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:161c8a8e-9d94-4789-81d1-68cc9b680bbc"}},"repository":{"url":"https://github.com/danger/risk.git","type":"git"},"description":"A modernized, minimal Danger JS for GitHub","directories":{},"dependencies":{"picomatch":"^4.0.2","parse-diff":"^0.11.1","@octokit/rest":"^21.1.1"},"_hasShrinkwrap":false,"packageManager":"yarn@4.12.0","devDependencies":{"vitest":"^3.0.5","typescript":"^5.7.3","@types/node":"^22.0.0","@types/picomatch":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/risk_0.0.5_1771841611048_0.8563400394992882","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"risk","version":"1.0.0","description":"A modernized, minimal Danger JS for GitHub","license":"MIT","author":{"name":"Orta Therox","email":"orta.therox@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/danger/risk.git"},"homepage":"https://github.com/danger/risk#readme","bugs":{"url":"https://github.com/danger/risk/issues"},"keywords":["danger","code-review","github","pull-request","ci","linting"],"type":"module","exports":{".":{"types":"./index.d.ts","require":"./dist/index.js","import":"./dist/index.js"}},"bin":{"danger":"dist/cli/danger.js"},"packageManager":"yarn@4.12.0","engines":{"node":">=22.18.0"},"scripts":{"build":"tsc","prepublishOnly":"npm run build","release":"node scripts/release.ts","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit"},"dependencies":{"@octokit/rest":"^21.1.1","parse-diff":"^0.11.1","picomatch":"^4.0.2"},"devDependencies":{"@types/node":"^22.0.0","@types/picomatch":"^3.0.1","typescript":"^5.7.3","vitest":"^3.0.5"},"gitHead":"9e25dbbec2f950b26410b17d8495700fc3a1b08c","types":"./index.d.ts","_id":"risk@1.0.0","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-IFZun9iXmG4tCgCr/kZ1+kwcV3deRKIuVINMDXX0uryATV2Xtam4bqIFdcn6ob/886ibHmdyNSa8w3XU2KmvSw==","shasum":"67d0675c17bc601347eacc267e97b9200e2a7ca7","tarball":"https://registry.npmjs.org/risk/-/risk-1.0.0.tgz","fileCount":105,"unpackedSize":180998,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/risk@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDaspNcG8F6fPP4Nwj4Yc98tM9BSiPAfGvRcS8262KfkAIhANcIw/FcQHeJ1t66I9ZttmxlsaapooDNihTKr1gOF3eA"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:63b04794-687a-4a02-bbe1-1a2618f065c6"}},"directories":{},"maintainers":[{"name":"orta","email":"orta.therox@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/risk_1.0.0_1787589050641_0.48451372559310024"},"_hasShrinkwrap":false}},"time":{"created":"2013-02-19T03:14:58.032Z","modified":"2026-08-24T16:30:51.134Z","0.0.0":"2013-02-19T03:14:59.659Z","0.0.2":"2026-02-21T15:27:13.555Z","0.0.3":"2026-02-21T15:43:11.109Z","0.0.4":"2026-02-22T12:09:31.092Z","0.0.5":"2026-02-23T10:13:31.220Z","1.0.0":"2026-08-24T16:30:50.775Z"},"bugs":{"url":"https://github.com/danger/risk/issues"},"author":{"name":"Orta Therox","email":"orta.therox@gmail.com"},"license":"MIT","homepage":"https://github.com/danger/risk#readme","keywords":["danger","code-review","github","pull-request","ci","linting"],"repository":{"type":"git","url":"git+https://github.com/danger/risk.git"},"description":"A modernized, minimal Danger JS for GitHub","maintainers":[{"name":"orta","email":"orta.therox@gmail.com"}],"readme":"# risk\n\nA smaller [Danger JS](https://danger.systems/js) runtime with a narrower scope: GitHub only, ESM only, Node 22.18+. Three runtime dependencies.\n\nFull documentation lives at [danger.systems/js](https://danger.systems/js) — the Dangerfile API is the same.\n\n## Installation\n\n```sh\nyarn add risk --dev\n```\n\n## Usage\n\nCreate a `dangerfile.ts` in your project root. Your project does not need `\"type\": \"module\"` — Dangerfiles are always evaluated as ESM:\n\n```ts\nimport { danger, warn, fail, message, markdown } from \"risk\"\n\nif (!danger.github.pr.body.length) {\n  fail(\"Please add a description to your PR.\")\n}\n\nconst bigPR = danger.github.pr.additions + danger.github.pr.deletions > 500\nif (bigPR) {\n  warn(\"This PR is quite large. Consider splitting it up.\")\n}\n\nmessage(`This PR modifies ${danger.git.modified_files.length} file(s).`)\n```\n\nExisting 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`:\n\n```jsonc\n{\n  \"compilerOptions\": {\n    \"types\": [\"risk\"]\n  }\n}\n```\n\n### Plugins\n\n`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.\n\n```ts\nimport { danger, warn } from \"risk\"\nimport jest from \"danger-plugin-jest\"\n\nschedule(jest())\n```\n\n### Commands\n\n**`danger ci`** — Run on CI against the current pull request.\n\n```sh\ndanger ci [options]\n```\n\n| Option | Description |\n| --- | --- |\n| `-d, --dangerfile <path>` | Path to Dangerfile (default: `dangerfile.ts`) |\n| `--id <id>` | Unique identifier for this run (default: `\"Danger\"`) |\n| `-t, --text-only` | Print to stdout instead of posting comments |\n| `--fail-on-errors` | Exit with code 1 if there are failures |\n| `--new-comment` | Always create a new comment |\n| `--remove-previous-comments` | Remove previous Danger comments |\n| `--base-url <url>` | GitHub API base URL (for GitHub Enterprise) |\n| `--no-publish-check` | Don't set a commit status |\n| `-v, --verbose` | Verbose logging |\n\n`danger --version` prints the installed version.\n\n**`danger pr <url>`** — Test your Dangerfile against an existing PR without posting comments.\n\n```sh\ndanger pr https://github.com/owner/repo/pull/123\n```\n\n### GitHub Actions\n\n```yaml\n- run: yarn danger ci\n  env:\n    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\nFor other CI providers, set `DANGER_GITHUB_API_TOKEN` and either `DANGER_PR_URL` or `DANGER_REPO_SLUG` + `DANGER_PR_ID`.\n\n### GitHub Enterprise\n\nSet `--base-url` or the `DANGER_GITHUB_API_BASE_URL` environment variable to your GHE API endpoint.\n\n## What's different from Danger JS\n\n- **GitHub only** — no GitLab or BitBucket support\n- **ESM only** — no CommonJS, no Babel transpilation\n- **Node 22.18+** — uses native type stripping, `fetch`, `parseArgs`, `styleText`\n- **Single process** — no subprocess/runner model\n- **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\n- **3 runtime deps** — `@octokit/rest`, `parse-diff`, `picomatch`\n\n## Releasing\n\n```sh\n# Update CHANGELOG.md with the new version, then:\nyarn release <patch|minor|major>\n```\n\nThis bumps `package.json`, commits, tags, and pushes. The [publish workflow](.github/workflows/publish.yml) handles creating the GitHub release and publishing to npm.\n","readmeFilename":"README.md"}