Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > require('tty').setRawMode(true);
- true
- > process.stdin.on('data', function(buf) { console.log(buf.toString('ascii').replace(/\x1b/g, 'ESC ') + "\n"); });
- { fd: 0,
- type: null,
- allowHalfOpen: false,
- _readWatcher: { socket: [Circular], callback: [Function: onReadable] },
- readable: true,
- _writeQueue: [],
- _writeQueueEncoding: [],
- _writeQueueFD: [],
- _writeQueueCallbacks: [],
- _writeWatcher: { socket: [Circular], callback: [Function: onWritable] },
- writable: true,
- _writeImpl: [Function],
- _readImpl: [Function],
- _shutdownImpl: [Function],
- _events: { data: [ [Function], [Function] ] } }
- > process.stdin.resume();process.stdin.resume();
- ESC f
- > process.stdin.ESC be();
- ESC
- > ESC d
Add Comment
Please, Sign In to add comment