Any documents for all nodejs event APIs?

I saw a code snippet as shown below:

process.stdin.on('keypress', function(c, key){          
if (key && 'enter' == key.name) { 

But, unfortunately, I could not find anything about how to use the event keypressin nodedocs. Obviously this is different from the event keypressin browsers. Also, there is nothing that the object would represent key, so I don't know how to use key.xxxor key.name == xxxto determine which key is pressed.

What am I missing? There must be somewhere I can find how to use node...

+3
source share
1 answer

The node documentation seems completely inadequate in this regard, as you mentioned.

, , - 'readline'-module:

function emitKey(stream, s) {
    var ch,
    key = {
        name: undefined,
        ctrl: false,
        meta: false,
        shift: false
    },

.., , Ctrl, shift - .

, :)

+4

All Articles