vt100
v0.2.0
Published
Player for VT100-Animations. Another way to spend a geeky afternoon
Downloads
19
Maintainers
Readme
VT100.js
Player for VT100-Animations. Play & enjoy old school animations on your terminal.
Intro
VT100-Animations are files containing special escaped character sequences, that old VT100-Terminals recognize and render.
Every modern Terminal can emulate these behaviours, but "unfortunately" they are too fast for this goal.
VT100.js comes to the rescue.
Quickstart
Install
nmp -g install vt100
Enjoy
curl https://raw.githubusercontent.com/gr3p1p3/vt100/master/animations/blinkeyes.vt | vt100
or
vt100 --src=absolute/path/to/file.vt
Enjoy more
You will find more animations hosted on official vt100 GitHub repository.
JS-API
You can use VT100.js not only as CLI, but for implement your own software too.
Example
This implement a simple TCP-Server that listens on a certain port and sends Animation to each connected client.
const net = require('net');
const Player = require('vt100');
const server = net.createServer(function onConnectedSocket(client) {
console.log('Connected client from', client.remoteAddress);
const p = Player('/path/to/file.vt',
{clearBefore: false}) //need to deactivate default vt100's behaviour
.on('data', function (data) {
client.write(data); //send animation-data
})
.on('end', function () {
client.write('\n\n\n\u001b[1000DHosted by @gr3p'); // send bye-message at begin of line
client.destroy(); //destroy client-connection after animation is done
});
//handling error of disconnected clients
client.on('error', function (error) {
console.log('Error for', client.remoteAddress, error.message);
p.destroy(); //destroy vt100-stream
});
});
server.listen(23, '0.0.0.0', function () {
console.log('Server was started!');
});
Watch:
telnet localhost
Bugs & Issues
This is actually a beta, fixes & issues are welcome.