elm-console
elm-console copied to clipboard
Handle EOF
Before: EOF is not handled at all. In particular, process.stdin.resume
is sometimes called on the closed stdin stream, and in that case node.js terminates without an error.
This is a proposal. The handling of EOF in this pull is a little bit hacky. The getC
request to the native module returns '\0'
if stdin is in EOF state. Better would be a proper error handling and isEof function. Right now, I have no idea how to do it. Feel free to make it better.
API changes:
- add
getContents
function incl. a test