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

mtga-reader

v0.1.13

Published

Node.js bindings for reading Magic: The Gathering Arena memory (cross-platform)

Readme

mtga-reader

GitHub Actions Workflow Status GitHub Release GitHub License npm

A high-performance native library for reading Magic: The Gathering Arena game memory. Extract player data, card collections, inventory, and more directly from the running game process.

Features

  • Cross-platform - Windows, Linux and macOS support with prebuilt binaries
  • Node.js bindings - First-class npm package powered by napi-rs
  • Memory introspection - Browse assemblies, classes, instances, and dictionaries
  • Zero runtime dependencies - Pure Rust core with no external requirements

Installation

npm install mtga-reader
# or
yarn add mtga-reader

Quick Start

const mtga = require('mtga-reader');

// Check if MTGA is running and read card collection
if (mtga.findPidByName('MTGA')) {
    const cards = mtga.readData('MTGA', [
        'WrapperController',
        '<Instance>k__BackingField',
        '<InventoryManager>k__BackingField',
        'InventoryServiceWrapper',
        '<Cards>k__BackingField',
        '_entries',
    ]);
    console.log(`You have ${cards.length} unique cards!`);
}

Note: Reading game memory requires administrator/root privileges.

API

Core Functions

| Function | Description | |----------|-------------| | readData(processName, path) | Traverse a path of fields from a root class | | readClass(processName, address) | Read a managed class at a memory address | | readGenericInstance(processName, address) | Read a generic instance at an address | | findPidByName(processName) | Check if a process exists | | isAdmin() | Check for administrator privileges |

Test Projects

This repository includes two test projects for development and debugging:

debug-ui

A React-based web interface for exploring MTGA memory structures interactively.

# Start the HTTP server (requires admin privileges)
cargo run --bin http_server_simple

# In another terminal, start the UI
cd debug-ui
npm install && npm run dev

Browse assemblies, inspect classes, read static instances, and explore dictionaries through a visual interface at http://localhost:3000.

node-test

A standalone Node.js test project demonstrating the native addon API.

cd node-test
npm install
npm run build
npm test  # Run as administrator

Tests the full API including assembly enumeration, class inspection, and data reading paths.

Development

Platform status: the high-level typed readers (readDecks, readRanks, readAccount, readCollection, readInventory) are implemented and verified on Windows/Mono and macOS/IL2CPP, and return identical JSON shapes on both. macOS needs root or the com.apple.security.cs.debugger entitlement for task_for_pid — see docs/MACOS_IL2CPP.md.

Prerequisites

  • Rust toolchain (stable)
  • Node.js 16+
  • MTGA installed and running (for testing)

Building

# Development build
yarn build:debug

# Production build
yarn build

Testing

# Run with MTGA open (requires admin)
cargo run --bin debug

Tests in lib.rs require MTGA to be running and cannot be automated in CI.

Releases

All releases are automated via GitHub Actions:

npm version patch|minor|major
git push --follow-tags

This triggers the napi-rs workflow which builds binaries for all platforms and publishes to npm.


About

This is a Rust port of Unity Spy, adapted for MTGA. The codebase reads Mono runtime structures directly from memory, enabling access to game state without log file parsing.

References: