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

@vttforge/core

v0.20.7

Published

Runtime for Foundry VTT v14+ systems and modules: registerSystem, registerModule, typed data models, sheet bases, settings, migrations, error registry.

Downloads

4,661

Readme

@vttforge/core

The runtime half of VTTForge: what a Foundry VTT v14+ system or module imports. A module reaches for everything below, plus the four rows marked for modules.

bun add @vttforge/core

What is in it

| Export | What it replaces | |---|---| | registerSystem / registerModule | The Hooks.once("init") block: data models, document classes, initiative, status effects, sheets, enrichers, and ready | | BaseTypeDataModel(defineSchema) | A TypeDataModel whose fields are typed from the schema, so this.level is a number inside prepareDerivedData | | fields() | foundry.data.fields, typed, read lazily so the module imports in Node | | InferSchema<T> / Model['$inferData'] | The hand-written interface that drifts from the schema | | BaseActorSheet() / BaseItemSheet() | static TABS, static DRAG_DROP, static MODES (play and edit, with the fields locked in play), typed onDropItem and friends on ActorSheetV2 / ItemSheetV2 with Handlebars | | resourceField() | The { value, max } field a token bar reads, typed as two numbers; registerSystem checks the manifest's bars against it | | postRoll() | Posts a roll as a chat card, tagged as a critical or a fumble by the thresholds you give | | dicePool() / stepDie() / countSuccesses() | The pool formula from a description, a die stepped along a ladder, successes counted on any roll | | promptFields() | A dialog from a list of fields, built with Foundry's input helpers, resolving to a typed object or null | | keywords on either registration | Rules terms as @Keyword[id] with a tooltip, and a journal entry the GM's client creates and keeps current | | BaseDocumentSheet('Actor' \| 'Item') / BaseApplication() | The same plumbing without Handlebars, for a sheet that builds its own element | | PackageConfig | game.settings.register/get/set with the package id filled in and unregistered reads caught | | createMigrationRunner | The schemaVersion setting, the isNewerVersion compare and the sequential await every system grows | | moduleSubType | The <module id>.<type> prefix Foundry files a module's sub-types under | | registerSocket | The game.socket channel, the manifest flag it needs, the sender id the server vouched for, and requests only a Gamemaster's client can answer | | moduleApi / requireModuleApi | Reading another package's api, and saying which of not installed, switched off or publishing nothing it was | | subTypeDocuments / convertSubTypes | Counting what a module's sub-types hold, and converting them back so uninstalling it strands nothing | | inject | Your own UI inside an application you do not own, replaced on each re-render rather than stacked | | VttfError | Runtime errors with a stable VTTF-NNNN code and a docs URL |

Registering a sheet

import { BaseActorSheet, registerSystem } from '@vttforge/core';

class CharacterSheet extends BaseActorSheet() {
  static PARTS = { sheet: { template: 'systems/my-system/templates/character.hbs' } };
}

registerSystem({
  id: 'my-system',
  actorDataModels: { character: CharacterData },
  sheets: [{ id: 'character', document: 'Actor', sheet: CharacterSheet, types: ['character'], makeDefault: true }],
});

Foundry keys a sheet by its class name and saves that key on every document. A bundler renames classes between builds, so registerSystem uses the id for the key instead.

Docs

Foundry v14+ only. The package runs in the browser inside Foundry; it reads the Foundry globals lazily, so it also imports cleanly in Node for tests.