spencermcw.com
[ << ] back to work
case file 04 / 12 · 2026

Steam Inventory Simulator

A mock of Steam's Inventory Service.

published Published on npm as steam-inventory-mock 0.1.0 checked 2026-10-13 [6]

A mock provider for Steam's Inventory Service, so a game's economy can be built and tested against the service's calls without a live app.

why Playtime drops, monthly promo recurrence and progression curves run on real wall-clock playtime, which makes them effectively untestable against live Steam. A virtual clock turns each one into a millisecond unit test. [1]

what it does

  • Exchange recipes, bundle and generator expansion, per-item tags, tag tools and accessories. [1]
  • Dynamic item properties with Steam's documented limits: 100 items a call, 1024 bytes of JSON an item. [1]
  • Playtime drops and promo grants on a virtual clock, with a seedable RNG. [1]
  • Save and load, including the RNG state, the clock and drop cool-downs. [1]
What it is
npm package: an in-process mock of Steam's ISteamInventory
Stack
runtime Node 20+ · CommonJS · zero runtime dependencies [2]
tests node:test, no framework · GitHub Actions on Node 20, 22, 24 [3]
types hand-written client.d.ts [1]
Tags
  • JavaScript
  • Steam
  • Tooling
Links
Source >>
  1. Two layers: MockProvider mirrors ISteamInventory one-to-one for a native binding to map onto, and an init() facade shaped like steamworks.js sits on top. [1]

  2. Exchange materials are matched by max-flow (Edmonds-Karp on a small bipartite graph). [1]

  3. The RNG is a seedable mulberry32 with 32 bits of state, so a save stores it as one integer. [1]

  4. Item instance ids cross the public API as bigint (they are uint64); everything inside stays JSON-safe numbers. [1]

  5. A 183-test conformance suite runs against any provider that declares its capabilities, so the same tests can be pointed at a real Steam binding. [1]

  6. Where Valve's docs are silent or contradict each other, the guess is a named, test-pinned option, and the README says plainly that nothing has been verified against real Steam. [1]

Languages, as GitHub reports them

by bytes [4]
  • JavaScript 100%
$ git log --reverse
  1. First commit: scaffold a standalone package [5]
  2. MIT license, CI and publish guard; 22 commits that day [5]
  3. steam-inventory-mock 0.1.0 published to npm [6]
  4. ISteamInventory bound in a fork of steamworks-rs [8]
  5. ...and exposed to JavaScript in a fork of steamworks.js [7]

Every marked line above points at one of these. Public repositories, registries and screenshots only; nothing is inferred past what they show.

  1. [1] README github.com 2026-10-13
  2. [2] package.json github.com 2026-10-13
  3. [3] .github/workflows/ci.yml github.com 2026-10-13
  4. [4] GitHub languages API api.github.com 2026-10-13
  5. [5] Commit history github.com 2026-10-13
  6. [6] npm registry: steam-inventory-mock npmjs.com 2026-10-13
  7. [7] spencermcw/steamworks.js pull requests github.com 2026-10-13
  8. [8] spencermcw/steamworks-rs commits github.com 2026-10-13