You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@szmarczak I think instead of hanging, the program is waiting for the end of stdin.
If you start logging what the program reads like the docs say, you will see that it comes to an end after the input is over:
❯ timeecho'here is a line'|node index
here is a line
echo'here is a line' 0.00s user 0.00s system 33% cpu 0.002 total
node index 0.07s user 0.02s system 63% cpu 0.140 total
@szmarczak if still need to address this issue and add this functionality to the doc I would like to take this and open a PR.
Just want to make sure what is being asked... in this API doc I need to add an example as you described? can you maybe give me any advice about in which section do you think that it would be wise to add this example to?
Activity
szmarczak commentedon Nov 17, 2020
Solved via
process.stdin.unref();szmarczak commentedon Nov 17, 2020
Although I think it would be nice to add this to docs, so I'll reopen.
RaisinTen commentedon Nov 20, 2020
@szmarczak I think instead of hanging, the program is waiting for the end of
stdin.If you start logging what the program reads like the docs say, you will see that it comes to an end after the input is over:
Here is the log of a run:
danielglazer commentedon Nov 20, 2020
@szmarczak if still need to address this issue and add this functionality to the doc I would like to take this and open a PR.
Just want to make sure what is being asked... in this API doc I need to add an example as you described? can you maybe give me any advice about in which section do you think that it would be wise to add this example to?
szmarczak commentedon Nov 20, 2020
At the end of
readline.createInterface(options)sectionDocumentation for how to unref readline
vbinithyanandamv commentedon Dec 9, 2020
I have added the example. Please let me know if it needs an update.
AnupamaP commentedon Mar 31, 2021
@aduh95 I see your review on the referenced PR, I can open a new PR addressing your comments there. Can I be assigned to this?
aduh95 commentedon Mar 31, 2021
@AnupamaP By all means, go for it :)
AnupamaP commentedon Apr 1, 2021
@aduh95 thanks, would appreciate your thoughts on my PR :)
doc: document how to unref stdin when using readline.Interface
doc: document how to unref stdin when using readline.Interface
doc: document how to unref stdin when using readline.Interface
doc: document how to unref stdin when using readline.Interface