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

riv-inspector

v0.2.0

Published

Extract metadata from .riv files as Markdown with YAML frontmatter

Readme

riv-inspector

License: MIT CI

Extract metadata from .riv files and write it as Markdown with YAML frontmatter.

riv-inspector <file.riv> [file2.riv ...] [options]

What it does

Reads a Rive file without a browser and outputs a .md file containing structured YAML describing the file's artboards, state machines, view models, data enums, and assets. Useful for documentation, code generation, or keeping a record of what's inside a .riv file.

riv-inspector demo

Example output:

---
file: animation.riv
artboards:
  - name: Main
    size: [732, 755]
    origin: [0, 0]
    stateMachines: [sm-main]
  - name: Button
    size: [200, 60]
    origin: [100, 30]
    stateMachines: [State Machine 1]
viewModels:
  - name: Main
    properties:
      - { name: isValid, type: boolean }
      - { name: states, type: enum, enum: States }
    instances: [Instance]
enums:
  - name: States
    values: [idle, active, done]
assets:
  images: [avatar.png]
  fonts: [Inter.ttf]
---

Requirements

  • Node.js v22.6 or later

Installation

From npm (recommended):

npm install -g riv-inspector

Or run without installing:

npx riv-inspector file.riv

From source:

git clone https://github.com/isaganttus/riv-inspector.git
cd riv-inspector
npm install
npm run build
npm install -g .

Usage

# Inspect a single .riv file — output defaults to <file>.md next to the input
npm run dev -- path/to/file.riv

# Or using the compiled binary
riv-inspector path/to/file.riv

# Specify a custom output path
riv-inspector path/to/file.riv --output path/to/output.md

# Print to stdout instead of writing a file
riv-inspector path/to/file.riv --stdout

# Output JSON to stdout
riv-inspector path/to/file.riv --json

# Pipe JSON to jq
riv-inspector path/to/file.riv --json | jq '.artboards'

# Output a JSON array for multiple files
riv-inspector a.riv b.riv --json

# Watch a single file for changes
riv-inspector path/to/file.riv --watch

# Inspect all .riv files in a folder
riv-inspector ./assets/

# Inspect all .riv files in a folder as a JSON array
riv-inspector ./assets/ --json

# Watch an entire folder for changes
riv-inspector ./assets/ --watch

# Create a config file and watch using it
riv-inspector --init-config
riv-inspector --watch

# Add a web preview link to the frontmatter
riv-inspector path/to/file.riv --web-preview https://rive.app/community/files/123

# Add an editor link to the frontmatter
riv-inspector path/to/file.riv --editor-link https://rive.app/editor/123

# Inspect multiple files at once
riv-inspector a.riv b.riv c.riv

# Print version
riv-inspector --version

Options

| Flag | Alias | Description | |---|---|---| | --output <path> | -o | Output path (single file only) | | --stdout | -s | Print Markdown to stdout instead of writing a file (single file only) | | --json | -j | Print JSON to stdout; multiple files output a JSON array | | --watch | | Re-inspect on file/folder changes; reads config if no paths given | | --init-config | | Create a starter .riv-inspector.json in the current directory | | --web-preview <url> | -w | Add a webPreview URL to the YAML frontmatter (single file only) | | --editor-link <url> | -e | Add an editorLink URL to the YAML frontmatter (single file only) | | --version | -v | Print version and exit | | --help | -h | Show help message |


Output fields

Artboards

| Field | Description | |---|---| | name | Artboard name | | size | [width, height] in pixels | | origin | [x, y] normalized position of the (0,0) anchor (0.0–1.0) | | stateMachines | Names of all state machines on this artboard |

Origin notes: [0, 0] means the origin is at the top-left corner. [0.5, 0.5] means it is centered. [1, 1] means it is at the bottom-right corner.

View Models

| Field | Description | |---|---| | name | View model name | | properties | List of { name, type[, enum] } entries | | instances | Named instances defined in the file |

Property types mirror the Rive DataType enum: boolean, number, string, color, trigger, enum, list, viewModel, image, artboard.

Enums

| Field | Description | |---|---| | name | Enum name | | values | All possible string values |

Assets

| Field | Description | |---|---| | images | Embedded or referenced image asset filenames | | fonts | Embedded or referenced font asset filenames | | audio | Embedded or referenced audio asset filenames |


Development

npm run dev -- file.riv     # Run from source
npm run build               # Compile TypeScript to dist/
npm test                    # Run tests
npm run typecheck           # Type-check without emitting

Config file

riv-inspector --init-config creates a .riv-inspector.json in the current directory:

{
  "watch": ["./"]
}

Run riv-inspector --watch with no positional arguments to watch all paths listed in the config. Paths are relative to where you run the command. The config file is gitignored by default.


How it works

The WASM runtime from @rive-app/canvas-advanced is loaded in Node.js with a minimal browser-global polyfill (no canvas, no WebGL). The .riv binary is parsed entirely in memory by the Rive C++ runtime compiled to WASM. No network requests are made.


Project structure

src/
  index.ts       CLI entry point — argument parsing and file I/O
  config.ts      Config file loading (.riv-inspector.json)
  inspector.ts   Loads the Rive WASM runtime and extracts metadata
  formatter.ts   Serialises RivMetadata to Markdown/YAML frontmatter
test/
  inspector.test.ts    Integration tests using node:test
  fixtures/
    sample.riv         Your .riv file goes here (not committed)

Contributing

See CONTRIBUTING.md for development setup, test instructions, and PR guidelines.

Please note that this project follows a Code of Conduct. By participating, you agree to uphold it.


License

MIT