1.1.0 • Published 5 years ago

webmc v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

webmc

npm version

Display the output of a process in browsers.

Demo

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));
1.1.0

5 years ago

1.0.0

5 years ago