Skip to content

Hadron67/webmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Display the output of a process in browsers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published