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]
-
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]
-
Exchange materials are matched by max-flow (Edmonds-Karp on a small bipartite graph). [1]
-
The RNG is a seedable mulberry32 with 32 bits of state, so a save stores it as one integer. [1]
-
Item instance ids cross the public API as bigint (they are uint64); everything inside stays JSON-safe numbers. [1]
-
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]
-
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%
Every marked line above points at one of these. Public repositories, registries and screenshots only; nothing is inferred past what they show.
- [1] README github.com 2026-10-13
- [2] package.json github.com 2026-10-13
- [3] .github/workflows/ci.yml github.com 2026-10-13
- [4] GitHub languages API api.github.com 2026-10-13
- [5] Commit history github.com 2026-10-13
- [6] npm registry: steam-inventory-mock npmjs.com 2026-10-13
- [7] spencermcw/steamworks.js pull requests github.com 2026-10-13
- [8] spencermcw/steamworks-rs commits github.com 2026-10-13