Message from JavaScript discussions

June 2019

— End of file

— 

The end of a stream (stdin for example, or stdout) or literally any other file (a text file, for example)

— stream.once('end', yourFunction)

— Generally

— So if it's stdin:
process.stdin.once('end', yourFunction)

— It was a value in C

— It was literally called EOF, you could do if (var != EOF) and it would work

— echo hey | node -e "process.stdin.once('end', () => console.log('ended')); process.stdin.resume()"
ended

Message permanent page

— This works for me in console

— You could do that, but would be more work

— Why?

— Because you have an end event