Skip to content

node-migrator-bot/termutil

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

terminfo utility for node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 51.5%
  • C 25.6%
  • JavaScript 18.9%
  • Python 4.0%