node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »



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.



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 {


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


To run the tests, simply run:

npm test