webmc
v1.1.0
Published
Display Minecraft log in browsers
Downloads
3
Readme
webmc
Display the output of a process in browsers.
Original purpose
This programme was originally used by me to display Minecraft log text when queueing in 2b2t, so I could see my position in queue when away from computer, such as when going out for dinner.
Usage
The CLI program is piping the output of a local port to a websocket so that can be viewed in browsers. The local port could be created by jmcl, which is what I usually do.
API
const createServer = require('webmc');
const server = createServer({
addr: 'localhost:8080', // server address, used in websocket handshake, port number must be consistent with `port'
port: 8080, // server port
decodeMC: true // whether to decode Minecraft color code
});
const childProcess = /* Create a child process, could be Minecraft */;
prc.stdout.on('data', data => server.write(data));