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

@yanick/tablet

v0.2.0

Published

Utilities to interact with roleplaying games' data tables

Readme

@yanick/tablet

I play role-playing games -- great fun! And -- funnier still -- I like to write scripts and whatnots to create characters, roll events, etc. Enter tablet, which is meant to provide tools to access, populate, and use role-playing game data tables.

Installation

pnpm install @yanick/tablet

Or, to make the script tablet available globally:

npm install -g @yanick/tablet

Tablet's killer feature

Now, while it's indubitably handy to have your games' tables in files, it's also incredibly boring to sit down and copy them wholesale from the original books. Which is where one key feature of tablet enter the picture. Let's say you have the file monster_encounters.md:

---
roll: 1d20
---

| roll | monster | notes                                   |
| ---  | ---     | ---                                     |
| 1-5  | Troll   | Only if there is a bridge nearby        |
| 6-8  | Orcs    | Roll 1d6 for number of orcs in the band |

To roll for a random encounter from the cli, you would do:

$ tablet roll ./monster_encounters.md

tablet will roll a d20 for you. If, say, it rolls a 12, which is not in the table, it will interactively ask you for the values of the new entry, and save it to the file. That way one can initially create minimal tables, and populate them incrementally.

From the CLI

tablet roll <table_file>

Randomly picks an entry of the table, and prints it (in Markdown format). If the rolled value doesn't have a corresponding entry, the user will interactively be asked to provide the entry's values, which will then be saved in the file.

The output format can be set via the --output option, and defaults to the format of the table file.

tablet print <table_file>

Prints the table to stdout.

The output format can be set via the --output option, and defaults to the format of the table file.

Table Format

Markdown

The file can have an optional frontmatter for metadata, and the table itself is using the GFM table syntax.

For example:

---
roll: 1d100
subtable: sub-table
---

| roll  | species | sub-table           | 
| ----  | ---     | ---                 |
| 1-10  | Human   |                     |
| 11-20 | Monster | species/monsters.md |

YAML

The file can have one or two YAML documents. If there is one, it's assumed to be the entries, if there are two, they are assumed to be the metadata and the entries, respectively.

For example:

---
roll: 1d100
---
- roll: 1-20
  species: Human
- roll: 21-30
  species: Kobold
- roll: 87
  species: Troll
- roll: 51
  species: Widget
- roll: 65
  species: Bump

JSON

The JSON document is expected to have the key entries, and optionally metadata.

For example:

{
  "entries": [
    {
      "roll": "1-20",
      "species": "Human"
    },
    {
      "roll": "21-30",
      "species": "Kobold"
    }
  ],
  "metadata": {
    "roll": "1d100"
  }
}

CSV

A regular CSV file. You can add metadata as commented out lines, which will be interpreted as a YAML document.

For example:

# roll: 1d100
1-20, Human
21-30, Kobold

Metadata

  • roll - what to roll when we want an entry of the table. The package roll is used for the roll syntax.
  • subtable - column name determining a sub-table file to roll for. If there is no sub-table value for the row, no further rolling is done. Optional.

Row data

If a table is table that can be rolled against, it requires a roll column, which either contains a single number or a range (e.g., 10-21).

Etymology

Incidentally, The name tablet is a nod to Gizmo Mathboy, dear friend and dreaded DM, who has a looooong-standing thread of translated Mesopotamian tablets on his blog and Mastodon.