https://github.com/ousttrue/termutil
terminfo utility for node.js
https://github.com/ousttrue/termutil
Last synced: over 1 year ago
JSON representation
terminfo utility for node.js
- Host: GitHub
- URL: https://github.com/ousttrue/termutil
- Owner: ousttrue
- Created: 2010-12-04T17:09:59.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-12-05T05:13:35.000Z (over 15 years ago)
- Last Synced: 2025-02-20T19:19:23.544Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 103 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# termutil
Termutil is an terminfo utility for term.js.
This module provide non block stdin input event
and terminfo command write to stdout.
## build
node-waf configure build
## usage
var termutil=require('termutil');
var term=new termutil.Term();
var keymap={
0x71: // q
function(){ process.exit(); },
0x68: // h
function(){ term.tcmd('cub1'); },
0x6a: // j
function(){ term.tcmd('cud1'); },
0x6b: // k
function(){ term.tcmd('cuu1'); },
0x6c: // l
function(){ term.tcmd('cuf1'); },
};
term.on('keyinput', function(code){
if(code in keymap){
keymap[code]();
}
else{
process.stdout.write('['+code+']');
}
});
term.tcmd('clear');
term.listen();