A full-blown terminal lib featuring: 256 colors, styles, keys & mouse handling, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, and many more...
Whether you just need colors & styles, build a simple interactive command line tool or a complexe terminal application: this is the absolute terminal lib for Node.js!
It does NOT depend on ncurses.
Some tutorials are available at blog.soulserv.net/tag/terminal.
This is a fraction of what Terminal-Kit can do, with only few lines of code. Click any image to see the documentation related to the feature!
New: Document model for building rich app GUI.
New: Promises can be used instead of callback everywhere.
New: Word-wrapping along full terminal width or a pre-defined column
New: ScreenBuffer HD (beta), 32-bit (RGBA) surfaces with composition and image loading
- colors, 256 colors or even 24-bit colors, if the terminal supports it
- styles (bold, underline, italic, and many more)
- style mixing
- string formatting
- short style markup
- terminal window title
- cursor positioning
- keyboard input
- mouse support (GPM is supported for the Linux Console)
- input field
- single line menu
- single column menu
- grid/table menu
- progress bar
- interactive 'yes or no'
- screen & off-screen buffers (a concept similar to SDL's Surface)
- text buffers
- change the terminal color palette
- draw an image file (PNG, JPEG, GIF) directly inside the terminal
- Platform: any xterm-compatible terminal.
These terminals have been successfully tested:
- Linux Console
- Your terminal? Help tracking terminal compatibilities on github!
// Require the lib, get a working terminalvar term = terminal ;// The term() function simply output a string to stdout, using current style// output "Hello world!" in default terminal's colors;// This output 'red' in redterm ;// This output 'bold' in boldterm ;// output 'mixed' using bold, underlined & red, exposing the style-mixing syntaxtermboldunderline ;// printf() style formatting everywhere:// this will output 'My name is Jack, I'm 32.' in greenterm ;// Since v0.16.x, style markup are supported as a shorthand.// Those two lines produce the same result." and I'm " ;;// Width and height of the terminal;// Move the cursor at the upper-left cornerterm ;// We can always pass additional arguments that will be displayed...term ;// ... and formatedterm ;// ... or even combined with other stylestermmoveTo ;// Get some user inputterm ;term;