This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Working on docs. |
cc @indutny |
Take a look at this slightly more complicated | ||
[example](https://gist.github.com/901104), and | ||
[http-console](https://github.com/cloudhead/http-console) for a real-life use | ||
case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples were removed because they are no longer valid with the API change.
May need a few more changes. Will continue testing. |
Known issues:
Working on a solution. Edit: Solution implemented. |
@@ -4,8 +4,8 @@ To use this module, do `require('readline')`. Readline allows reading of a | |||
stream (such as STDIN) on a line-by-line basis. | |||
|
|||
Note that once you've invoked this module, your node program will not | |||
terminate until you've closed the interface, and the STDIN stream. Here's how | |||
to allow your program to gracefully terminate: | |||
terminate until you've paused the interface. Here's how to allow your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change last sentence? It's meaningless now (you're stating same thing as in first sent. )
Lets talk about issues:
|
otherwise, lgtm. |
But please squash commits once you'll fix error |
May be we should add a deprecation warning to |
Related: nodejs#2737 nodejs#2756 - Removed extra newline from .question(); Users can input a newline if it they require it. - Removed .close() due to it only emulating closing, causing a bug where readline is left open to trigger events such as .on('line', ...'). - Removed ._attemptClose() - .pause() now triggers event .on('pause', ...) - .resume() now triggers event .on('resume', ...) - CTRL-C (SIGINT) in readline will now default to .pause() if no SIGINT event is present. - CTRL-D (delete right) will also default to .pause() if there is nothing to delete (signaling the end of the file). - Added new event `SIGTSTP` - Added new event `SIGCONT` - Added `resume` to `write` to resume the stream if paused. - Docs updated. - Updated repl.js
landed in ce48579 Thank you! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #2737 #2756
newline if it they require it.
readline is left open to trigger events such as .on('line', ...').
is present.
delete (signaling the end of the file).
SIGTSTP
SIGCONT
resume
towrite
to resume the stream if paused.