Browse Source

Add example to TTY documentation

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
47f5fd01e1
  1. 13
      doc/api/tty.markdown

13
doc/api/tty.markdown

@ -2,6 +2,19 @@
Use `require('tty')` to access this module.
Example:
var tty = require('tty');
tty.setRawMode(true);
process.stdin.resume();
process.stdin.on('keypress', function(char, key) {
if (key && key.ctrl && key.name == 'c') {
console.log('graceful exit');
process.exit()
}
});
### tty.open(path, args=[])

Loading…
Cancel
Save