terminal-kit
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -6,2 +6,3 @@ | ||
Terminal utilities for node.js, it supports 'xterm' compatible terminal and the Linux Console. | ||
It does not depend on ncurses. | ||
@@ -16,3 +17,3 @@ * License: MIT | ||
# Feature | ||
# Features | ||
@@ -38,4 +39,23 @@ * colors | ||
term.bold( 'bold' ) ; // output 'bold' in bold | ||
term.bold.underline.red( 'mixed' ) ; // output 'mixed' using bold, underlined red, exposing style-mixing syntax | ||
term.green( "My name is %s, I'm %d.\n" , 'Jack' , 32 ) ; // printf() style formating everywhere: this will output 'My name is Jack, I'm 32.' in green | ||
// output 'mixed' using bold, underlined red, exposing style-mixing syntax | ||
term.bold.underline.red( 'mixed' ) ; | ||
// printf() style formating 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 ) ; | ||
// 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 additionnal 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 ) ; | ||
``` | ||
@@ -47,3 +67,5 @@ | ||
All those functions are chainable, and their arguments can be combined. | ||
## Common/Misc | ||
@@ -114,3 +136,3 @@ | ||
* hidden(): invisible, but can be copy/paste'd | ||
* strike(): strike throught | ||
* strike(): strike through | ||
@@ -147,3 +169,2 @@ | ||
* applicationKeypad(): should allow keypad to send different code than 0..9 keys, not widely supported | ||
* grabInput(options): turn input grabbing on, keyboard entry will not be echoed, every input will generate an event | ||
@@ -165,4 +186,8 @@ | ||
# Input management with `grabInput()` | ||
* grabInput(options): turn input grabbing on, keyboard entry will not be echoed, every input will generate an event | ||
Quick example: | ||
@@ -179,3 +204,3 @@ | ||
term.bold.cyan( 'Key test, hit anything on the keyboard to see how it is detected...\n' ) ; | ||
term.bold.cyan( 'Type anything on the keyboard...\n' ) ; | ||
term.green( 'Hit CTRL-C to quit.\n\n' ) ; | ||
@@ -182,0 +207,0 @@ |
{ | ||
"name": "terminal-kit", | ||
"version": "0.1.3", | ||
"description": "Terminal utilities.", | ||
"version": "0.1.4", | ||
"description": "Terminal utilities with supports for colors, styles, inputs, mouse and many more...", | ||
"main": "lib/terminal.js", | ||
@@ -27,3 +27,8 @@ "directories": { | ||
"terminal", | ||
"color" | ||
"xterm", | ||
"color", | ||
"style", | ||
"input", | ||
"mouse", | ||
"cursor" | ||
], | ||
@@ -30,0 +35,0 @@ "author": "Cédric Ronvel", |
@@ -6,2 +6,3 @@ | ||
Terminal utilities for node.js, it supports 'xterm' compatible terminal and the Linux Console. | ||
It does not depend on ncurses. | ||
@@ -16,3 +17,3 @@ * License: MIT | ||
# Feature | ||
# Features | ||
@@ -38,4 +39,23 @@ * colors | ||
term.bold( 'bold' ) ; // output 'bold' in bold | ||
term.bold.underline.red( 'mixed' ) ; // output 'mixed' using bold, underlined red, exposing style-mixing syntax | ||
term.green( "My name is %s, I'm %d.\n" , 'Jack' , 32 ) ; // printf() style formating everywhere: this will output 'My name is Jack, I'm 32.' in green | ||
// output 'mixed' using bold, underlined red, exposing style-mixing syntax | ||
term.bold.underline.red( 'mixed' ) ; | ||
// printf() style formating 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 ) ; | ||
// 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 additionnal 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 ) ; | ||
``` | ||
@@ -47,3 +67,5 @@ | ||
All those functions are chainable, and their arguments can be combined. | ||
## Common/Misc | ||
@@ -114,3 +136,3 @@ | ||
* hidden(): invisible, but can be copy/paste'd | ||
* strike(): strike throught | ||
* strike(): strike through | ||
@@ -147,3 +169,2 @@ | ||
* applicationKeypad(): should allow keypad to send different code than 0..9 keys, not widely supported | ||
* grabInput(options): turn input grabbing on, keyboard entry will not be echoed, every input will generate an event | ||
@@ -165,4 +186,8 @@ | ||
# Input management with `grabInput()` | ||
* grabInput(options): turn input grabbing on, keyboard entry will not be echoed, every input will generate an event | ||
Quick example: | ||
@@ -179,3 +204,3 @@ | ||
term.bold.cyan( 'Key test, hit anything on the keyboard to see how it is detected...\n' ) ; | ||
term.bold.cyan( 'Type anything on the keyboard...\n' ) ; | ||
term.green( 'Hit CTRL-C to quit.\n\n' ) ; | ||
@@ -182,0 +207,0 @@ |
@@ -48,3 +48,4 @@ #!/usr/bin/env node | ||
term( term.esc.blue.on + 'Blue' ) ; | ||
term.styleReset() ; term( 'normal' ) ; | ||
term.styleReset() ; term( 'normal\n' ) ; | ||
term( 'The terminal size is %dx%d' , term.width , term.height ) ; | ||
term.saveCursor() ; | ||
@@ -60,2 +61,3 @@ | ||
term.move( -2 , -5 ) ; term.bold.brightGreen( '(-2;-5)' ) ; | ||
term.moveTo.cyan( 1 , 2 , "My name is %s, I'm %d.\n" , 'Jack' , 32 ) | ||
term.restoreCursor() ; | ||
@@ -62,0 +64,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
323821
1612
215