Skip to content

Commit

Permalink
It's alive!
Browse files Browse the repository at this point in the history
  • Loading branch information
jory committed Mar 2, 2015
1 parent b2108dc commit a2f6f9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -21,7 +21,6 @@
},
"homepage": "https://github.com/jory/ttyplayer",
"dependencies": {
"ansi": "^0.3.0",
"file-api": "^0.10.4",
"hoek": "^2.11.0"
}
Expand Down
20 changes: 5 additions & 15 deletions ttyplayer.js
@@ -1,8 +1,5 @@
var util = require('util');

var keypress = require('keypress');
keypress(process.stdin);

var fileParser = require('./file-parser');
var ttyrecDecoder = require('./ttyrec-decoder');

Expand All @@ -13,8 +10,6 @@ module.exports = function (file) {
var printFrame = function (index) {
console.log('\u001B[2J\u001B[0;0f');

console.log("~> ", index);

var out = [];
var frame = ttyrec.frames[index];
for (var i = 0, il = frame.length; i < il; i++) {
Expand All @@ -35,17 +30,12 @@ module.exports = function (file) {

var index = 0;

process.stdin.on('keypress', function (ch, key) {
console.log('got "keypress"', key);
if (key && key.ctrl && key.name == 'c') {
process.stdin.pause();
} else {
printFrame(index++);
}
});
var blugh = function () {
printFrame(index++);
setTimeout(blugh, 100);
};

process.stdin.setRawMode(true);
process.stdin.resume();
blugh();
});
});
};

0 comments on commit a2f6f9c

Please sign in to comment.