Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

tritmapped-terminal

1.0.0 • Public • Published

tritmapped-terminal

Tricolor tritmapped 45x28 character 9x14 terminal display

Usage:

var Triterm = require('tritmapped-terminal');

var t = Triterm(opts);

t.writeUChar('H');
t.writeUChar('i');
t.refresh();

Emulates a terminal wrapping a tritmapped-canvas, with 9x14 character output and keyboard input from trit-text.

For an example, run npm start or try the live demo. Type characters to write to the tritmapped trit-text terminal.

Options:

  • handleInput: function to call with (tt, ev) trit-text character codepoint and HTML5 DOM event when user presses a key
  • cooked (true): if true, writing characters interprets control codes
  • all options are passed through to tritmapped-canvas

API:

t.writeUChar(u)

Write a Unicode character (must be supported by trit-text).

t.setTTChar(tt, x, y)

Set (x,y) coordinate to a trit-text character tt.

t.refresh()

Redraw the HTML5 canvas.

t.writeTTChar(tt)

Write a trit-text character and append the hardware cursor.

t.forward()

Move the cursor forward, incrementing the column, and if at the end, incrementing the row if necessary then resetting the column.

t.backspace()

Move the cursor backwards, decrementing the column, and if at the beginning, decrement the row if necessary then resetting the column.

install

npm i tritmapped-terminal

Downloadsweekly downloads

4

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability