• Stars
    star
    3,103
  • Rank 14,488 (Top 0.3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terminal utilities for node.js

★ License Downloads Version Run on repl.it

Stats

Terminal Kit

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.

Screenshot, PleaZe!

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!

Styles output

Word-wrapping ← Word-wrapping

Table ← Table with automatic column computing, cell fitting and word-wrapping

Input field output

File input output

Input field output

Single line menu output

Single column menu output

Grid menu output

Progress bar output

Progress bar output

Slow typing output

Yes or no output

Spaceship ← Surfaces and Sprites

Draw an image inside the terminal ← Load and draw an image inside the terminal

Key features

New: Document model for building rich app GUI

New: Spinner

New: Table with automatic column computing, cell fitting and word-wrapping

New: Promises can be used instead of callback everywhere

New: Word-wrapping along full terminal width or a pre-defined column-width

New: ScreenBuffer HD 32-bit (RGBA) surfaces with composition and image loading

Quick examples

// Require the lib, get a working terminal
var term = require( 'terminal-kit' ).terminal ;

// The term() function simply output a string to stdout, using current style
// output "Hello world!" in default terminal's colors
term( 'Hello world!\n' ) ;

// This output 'red' in red
term.red( 'red' ) ;

// This output 'bold' in bold
term.bold( 'bold' ) ;

// output 'mixed' using bold, underlined & red, exposing the style-mixing syntax
term.bold.underline.red( 'mixed' ) ;

// printf() style formatting everywhere:
// this will output 'My name is Jack, I'm 32.' in green
term.green( "My name is %s, I'm %d.\n" , 'Jack' , 32 ) ;

// Since v0.16.x, style markup are supported as a shorthand.
// Those two lines produce the same result.
term( "My name is " ).red( "Jack" )( " and I'm " ).green( "32\n" ) ;
term( "My name is ^rJack^ and I'm ^g32\n" ) ;

// Width and height of the terminal
term( 'The terminal size is %dx%d' , term.width , term.height ) ;

// Move the cursor at the upper-left corner
term.moveTo( 1 , 1 ) ;

// We can always pass additional arguments that will be displayed...
term.moveTo( 1 , 1 , 'Upper-left corner' ) ;

// ... and formated
term.moveTo( 1 , 1 , "My name is %s, I'm %d.\n" , 'Jack' , 32 ) ;

// ... or even combined with other styles
term.moveTo.cyan( 1 , 1 , "My name is %s, I'm %d.\n" , 'Jack' , 32  ) ;

// Get some user input
term.magenta( "Enter your name: " ) ;
term.inputField(
	function( error , input ) {
		term.green( "\nYour name is '%s'\n" , input ) ;
	}
) ;

I want to READ THE DOC NOW!

License: MIT

More Repositories

1

tree-kit

Tree utilities (extend, mask, etc...)
JavaScript
29
star
2

string-kit

A string manipulation toolbox
JavaScript
20
star
3

spellcast

Make your own adventure!
JavaScript
19
star
4

async-kit

A simple and powerful async abstraction layer lib to easily write Node.js code flow.
JavaScript
18
star
5

freedesktop-notifications

Send freedesktop.org Notifications using D-Bus.
JavaScript
16
star
6

stereogram

Open Source Orthoptics Stereogram!
11
star
7

atomic-terminal

A terminal powered by Electron.
JavaScript
11
star
8

kung-fig

The Kung Fu of configuration files!
JavaScript
11
star
9

leeted

A sprite editor for terminal application. ASCII Art, UTF8 Art & ANSI Art are supported.
JavaScript
8
star
10

rest-query

The Awesome REST Framework!
JavaScript
7
star
11

http-requester

Perform HTTP & WS requests like a boss! A command line utility that supports HTTP, HTTPS, Websocket and server creation. Ideal for testing and debugging.
JavaScript
7
star
12

nextgen-events

Next generation of events handling for node.js
JavaScript
6
star
13

slash

The hackable shell.
JavaScript
6
star
14

doormen

Validate, sanitize and assert.
JavaScript
5
star
15

tea-time

Unit test: Tea Time!
JavaScript
5
star
16

tif-parser

Tab Indented Format Parser
JavaScript
4
star
17

ne

Ne a.k.a. Neon.
JavaScript
4
star
18

jsbindat

A javascript binary serializer.
JavaScript
3
star
19

babel-tower

I18n!
JavaScript
3
star
20

lazyness

Lazy loaders
JavaScript
2
star
21

libnotify-ffi

A node module providing low-level access to libnotify through node-ffi (Foreign Function Interface), and an higher level API.
JavaScript
2
star
22

nested-proxies

A Deep Proxy!
JavaScript
2
star
23

markdown-kit

Markdown utility.
JavaScript
2
star
24

uphysics

Unrealistic physic engine.
JavaScript
1
star
25

logfella

Minimalistic logger.
JavaScript
1
star
26

stats-modifiers

Stats and modifiers lib for gamedev.
JavaScript
1
star
27

uint8-buffer-kit

Mini toolbox using Uint8Array like a Node.js buffer.
JavaScript
1
star
28

launcher-kit

Toolkit for launching things.
JavaScript
1
star
29

spellcast-ext-web-client

Spellcast's Web Client Extension
JavaScript
1
star
30

wfm

Workflow manager.
JavaScript
1
star
31

roots-db

Minimalistic ODM.
JavaScript
1
star
32

svg-kit

A small SVG toolkit
JavaScript
1
star
33

kung-fig-dynamic

Interface for Dynamic kung-fig objects.
JavaScript
1
star
34

logfella-client

A simple client for Logfella.
JavaScript
1
star
35

tview

Open images inside the terminal!
JavaScript
1
star
36

3d-kit

A small 3D kit using Three.js inside Electron.
JavaScript
1
star
37

async-try-catch

Async try catch!
JavaScript
1
star
38

stream-kit

Stream utilities
JavaScript
1
star
39

json-kit

JSON stringify() and parse() and more in pure JS.
JavaScript
1
star