readLine
Closed this issue · 1 comments
readLine :: forall m r. MonadAff m => Readable r -> m { buffers :: Array Buffer, readagain :: Boolean }Could we use https://nodejs.org/api/readline.html ?
Instances of the
InterfaceConstructorclass are constructed using thereadlinePromises.createInterface()orreadline.createInterface()method. Every instance is associated with a singleinputReadablestream and a singleoutputWritablestream. Theoutputstream is used to print prompts for user input that arrives on, and is read from, theinputstream.
The problem with this is that it requires a Writable stream “used to print prompts”? That seems stupid and I don’t want to require a Writable stream in our API.
If the
InterfaceConstructorwas created withoutputset tonullorundefinedthe prompt is not written.
Ok so maybe we just readline.createInterface with a null Writable every time the readLine function is called, handle the 'line' event, and then destroy the interface when the readLine function completes.
Closing as this repo is deprecated.