Starcraft 2 replay file parsing with node.js!
JavaScript Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
Makefile
README.md
package.json

README.md

comsat

comsat is a node.js library for parsing Starcraft 2 replay files.

The library utilizes mpyq for replay extraction, with parsing all done through javascript.

Usage

simple

This code will print a listing of the player slots in this replay. You can do a lot more with comsat, however, see the source, tests and/or util.inspect for examples of the kind of data you can pull out (eventually I will have a list here of members for each of the properties on the Replay objects).

var comsat = require('comsat');
comsat.loadReplay('/path/to/replay.SC2Replay', false /* deleteFile */, function(err, rep) {
    if(err) throw err;

    for(var i = 0; i < rep.players.length; i++) {
        if(rep.players[i]) {
            console.log(rep.players[i].name, ' - ', rep.players[i].race.value);
        }
        else {
            console.log('Open');
        }
    }
});

Installation

comsat uses mpyq for extracting and decompressing replays and map files, so you'll need both python and mpyq.

You may also need to install some additional dependencies for node-bigint. See the install guide for more details.

To install comsat itself, use npm:

npm install comsat

Testing

To run the tests, simply run:

npm test