1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 00:54:14 +02:00

initial handling of hl2dm

This commit is contained in:
Robin Appelman 2018-03-06 22:03:10 +01:00
commit 04fc9b1f76
9 changed files with 730 additions and 479 deletions

View file

@ -1,6 +1,5 @@
import {ParseMode} from "../src/Demo";
const Demo = require('../index');
const ParseMode = require('../build/Demo').ParseMode;
const fs = require('fs');
const argv = require('minimist')(process.argv.slice(2), {boolean: true});
@ -17,7 +16,7 @@ const echo = function (data) {
fs.readFile(argv._[0], function (err, data) {
if (err) throw err;
const demo = Demo.fromNodeBuffer(data);
const analyser = demo.getAnalyser(argv.slow ? ParseMode.ENTITIES : ParseMode.MINIMAL);
const analyser = demo.getAnalyser(argv.slow ? ParseMode.ENTITIES : Demo.ParseMode.MINIMAL);
const head = analyser.getHeader();
if (argv.head) {
echo(head);