Skip to content

Matt-Esch/opentty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opentty

Get TTY read access

Example

var openTTY = require('opentty');
var restoreTTY = require('restoretty');

var tty = openTTY();

// quit on Q pressed
tty.on('data', function (d) {
    for (var i = 0; i < d.length; d++) {
        if (d[i] === 0x71) {
            restoreTTY();  // turn off raw mode
            return process.exit();
        }
    }
});

Installation

npm install opentty

Contributors

  • Matt Esch

MIT Licenced

About

Open a TTY read stream

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published