stdio-gui

0.0.0 • Public • Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i stdio-gui

      Weekly Downloads

      0

      Version

      0.0.0

      License

      MIT

      Last publish

      Collaborators

      • lachrist