0.0.0 • Published 7 years ago

stdio-gui v0.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

stdio-gui

StdioGUI is a terminal emulator for browsers which works with node.js streams thanks to browserify.

var StdioGui = require("stdio-gui");
var stdin = new Stream.Writable(...);
var stdout = new Stream.Readable(...);
var stderr = new Stream.Readable(...);
var div = document.createElement("div");
var stdiogui = StdioGui(div, {
  encoding: "utf8",
  greeting: "> ",
  onctrl: function (key) {
    if (key === "c") {
      console.log("SIGINT");
    } else if (key === "d") {
      stdin.write(null);
    }
  }
});
var stdio = [stdin, stdout, stderr];
stdiogui(stdio);