1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-03 16:44:12 +02:00
TF2 demo parsing in javascript
  • TypeScript 95.5%
  • JavaScript 4.3%
  • Makefile 0.2%
Find a file
2017-02-22 23:50:30 +01:00
bin parse world boundary 2017-02-11 18:01:51 +01:00
src extract activeWeapon 2017-02-22 23:50:30 +01:00
typings add basic snapshot test 2017-02-12 16:33:30 +01:00
.babelrc code organization and some es6 2016-12-18 15:12:55 +01:00
.gitignore initial typescript conversions 2016-12-18 15:37:29 +01:00
.npmignore add test for new celt codec 2017-02-17 23:18:45 +01:00
index.js final typescript conversion 2016-12-18 20:15:18 +01:00
LICENCE Create LICENCE 2017-02-17 23:56:45 +01:00
Makefile add seperate build with es6 modules 2017-02-18 23:59:11 +01:00
mocha.opts add basic snapshot test 2017-02-12 16:33:30 +01:00
package.json bump version 2017-02-21 21:58:46 +01:00
README.md add pov note to readme 2016-12-22 00:23:45 +01:00
tsconfig.es6.json add seperate build with es6 modules 2017-02-18 23:59:11 +01:00
tsconfig.json add test for new celt codec 2017-02-17 23:18:45 +01:00
typings.json add basic snapshot test 2017-02-12 16:33:30 +01:00

demo.js

Parsing of TF2 demo files in node.js and the browser

usage

###cli

node bin/analyse demo.dem

api

var Demo = require('tf2-demo');
var fs = require('fs');

fs.readFile("example.dem", function (err, data) {
	if (err) throw err;
	var demo = Demo.fromNodeBuffer(data);
	var parser = demo.getParser();
	var head = parser.readHeader();
	console.log(head);
	var body = parser.parseBody();
	console.log(body);
});

A note on POV demos

During the development of this project the main focus has always been on parsing STV demos. Parsing POV demos is a lot more error prone and has known issues.

Known issue with POV demos

  • Not all player names can be parsed correctly, resulting in multiple players having null as a name in the output.