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

@rppdice/example

v1.1.0

Published

Public mechanic-shape sample TRPG systems for RppDice. Ships a directory of canonical TOML samples plus a `*.toml` ambient type so consumers can `import` them directly.

Readme

@rppdice/example

RppDice のための公開可能・MIT ライセンスのメカニクス雛形 TRPG システム集。 特定の市販 TRPG の移植ではなく、TOML スキーマで表現できる異なるダイスメカニクス形を例示するもので、 自分のシステムプラグインを書くときにサンプルとして便利です。

同梱サンプル

| サンプル id | メカニクス | | ---------------------------- | ----------------------------------------------------------- | | three-band-2d6 | 2d6 + 修正値、3 段階成功 (大成功 / 並 / 失敗) | | roll-under-3d6 | 3d6 ロールアンダー + クリティカル / ファンブル | | percentile-bonus-penalty | d100 + ボーナス / ペナルティダイス、合成判定 | | d20-advantage | d20 + 修正値、有利 / 不利 | | exploding-d10-pool | d10 プール、クリティカルで爆発 | | rating-table-loop | レーティング表、条件付き再振りループ | | fumble-table-d20 | kind = "ranges" の range マップ表 (1-3 / 4-10 / ...) | | pair-detect-2d6 | 2d6、ぞろ目検出 | | compound-condition-d6-pool | d6 プール、複合条件で判定 | | coin-flip | 1d2、表 / 裏ラベル + COIN<N> のバッチ実行(多コマンド構成) | | multi-command-combat | 1 システムに INIT / ATK / DMG / HEAL の 4 コマンド |

インストール

npm install @rppdice/example

ランタイムコンテンツとして使う

.toml は型付きサブパス export で公開されます。本体は import 時点で SystemTomlBody<"<id>">(SystemId リテラルで brand された文字列型)に推論されるので、どのサンプルを取り込んでいるかが型で確認できます:

import TB_TOML from "@rppdice/example/systems/three-band-2d6.toml";
// ^ SystemTomlBody<"three-band-2d6">
import { createRegistry, loadSystem, evalSystem } from "@rppdice/core";

const registry = createRegistry();
const id = loadSystem(registry, TB_TOML); // runtime value: "three-band-2d6"

evalSystem(registry, id, "TB+3", { seed: 42n });

なお loadSystem の戻り値型は string で固定です(brand は import 側で保持され、登録後は通常の id 文字列として扱う設計)。サンプル id をリテラルとして取り回したい場合は SystemId ユニオンを直接使ってください。

.toml import の配線

.toml はネイティブな ESM 型ではないため、コンシューマ側でローダーを登録します:

  • Vitevite-plugin-toml を入れるか、本リポジトリ site/vite.config.ts のインライン tomlAsString プラグインを参考に。
  • Node — ESM load hook を登録すれば .toml を文字列として import 可能。

作成リファレンスとして使う

自分の TRPG に一番近いサンプルをコピーして編集し、@yourscope/system-<name> (またはスコープなし) で publish:

cp node_modules/@rppdice/example/src/systems/three-band-2d6.toml ./my-system.toml
npx rppdice validate ./my-system.toml
npx rppdice trace ./my-system.toml "TB+3" --seed 42

サンプルの TOML 自体が一番手っ取り早いリファレンスです: src/systems/ を読み比べると outcome.rules + flagstablesfunctionsi18n.<tag> の典型パターンがすべて出てきます。

ライセンス

MIT。LICENSE を参照。src/ の全 TOML はオリジナルのメカニカルコンテンツで、ルールブックの散文は一切含みません。