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

@frmds/transformers

v1.0.4

Published

Shared transformers for the Autodoc module of the Frontier Mods `.devtools`

Downloads

673

Readme

@frmds/transformers

transformers is the standard set of Autodoc transformers: the building blocks that compile a higher-level, composable, DRY mod source down into game-ready Cataclysm: Dark Days Ahead JSON.

These transformers are not run on their own. Autodoc loads and runs them while building a mod, and each one is independent, so you declare only the ones you want.

Install

bun add @frmds/transformers

Usage

Declare the transformers under autodoc.transformers in your mod's frontier.json5. They run in declaration order:

autodoc: {
	transformers: [
		// every transformer this package ships
		{ package: "@frmds/transformers", export: "ALL_TRANSFORMERS" },

		// or a hand-picked subset, by export name
		{ package: "@frmds/transformers", export: ["MATH_TRANSFORMER", "PRICE_TRANSFORMER"] },
	],
}

Without any transformers declared, none run. You must specify which transformers Autodoc should use for the mod.

Available transformers

Each transformer is independent and links to its own guide. Declare only the ones you want.

CANONICAL_TRANSFORMER

Author in any unit system and ship clean metric.

{ weight: "2 lbs" } // → { weight: "907 g 185 mg" }

DIMENSIONS_TRANSFORMER

Describe an object's shape and get its volume and longest side.

// a shape's measurements become volume and longest_side
{ dimensions: { type: "cylinder", diameter: "2 in", length: "6 in" } }

FOV_TRANSFORMER

Derive an optic's field of view from a real aperture or distance.

{ field_of_view: { height: "1.8 m", distance: "100 m" } } // → 60

FUNCTION_TRANSFORMER

Define a parameterized template once, then stamp it out by call.

// `pals/columns` turns a webbing column count into a real width
{ width: { fn: "pals/columns", args: [2] } }

INHERITANCE_TRANSFORMER

Share one parent definition across a family of objects.

// pull in chassis's properties, override what differs
{ id: "vest", type: "ITEM", inherit: "chassis" }

ITEM_GROUP_VARIANTS_TRANSFORMER

Turn one spawn entry into a group per item variant.

// one group per variant, plus an `:any`
{ item: "vest", from: ["multicam", "black"] }

MAGAZINE_POUCH_TRANSFORMER

Describe a pouch's design and get its computed pocket stats.

// a pouch design becomes encumbrance, ripoff, and moves
{ magazine_pouch: { type: "FLAP", capacity: 1 } }

MATH_TRANSFORMER

Compute values with full unit awareness.

// quantity-aware: 50 g, doubled, converted to kg
{ math: ["50 g", { op: "multiply", value: 2 }, { op: "convert", value: "kg" }] }
// → "0.1 kg"

PATCH_TRANSFORMER

Apply structured edits to the object in place.

// append to an array without restating it
{ patch: [{ op: "append", key: "subtypes", value: "ARMOR" }] }

POCKET_MULTI_TRANSFORMER

Repeat an identical pocket by count.

// two identical pockets from one entry
{ pocket_type: "CONTAINER", multi: 2 }

PRICE_TRANSFORMER

Rate an item by criteria and get a consistent barter price.

// rate by criteria, get a price off one shared curve
{ price_postapoc: { utility: "high", longevity: "high", scarcity: "high" } }
// → "51 USD"

REFERENCE_TRANSFORMER

State a value once and point everything else at it.

// borrow stanag20's weight, so it tracks the source
{ weight: { ref: "stanag20", key: "weight" } }

VARIANTS_TRANSFORMER

Expand a list of names into an item's full variant set.

// each name becomes a full variant
{ from: ["multicam", ["black", 2]] }