简体   繁体   中英

Looking for documentation on process.stdin.on in node.js

I'm refreshing my memory on JavaScript (wow things have changed in the last couple of years) and learning node. Step one for me in learning anything is to acquaint myself with the docs. I found nodejs.org/api as a great documentation source for node.js .

So I'm trying to understand how process.stdin.on works. I found the process.stdin documentation here on nodejs.org , and stdin.on is listed as an example, so I can kind of infer how it works:

process.stdin.on('end', () => {
  process.stdout.write('end');
});

But I can't find any specific documentation on the on method for stdin. Does anyone know where that documentation can be found? Thanks in advance!

This is for whoever may come across this question also learning node. The "on" method is in the EventEmitter class, with documentation found here as JJJ pointed out in the comments. NodeJS is quite beautiful, but wading through nodejs.org/api can be challenging as a beginner.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM