From 728386bfb21e6cd3a190bab4c597322b63099674 Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 27 Feb 2012 11:09:34 -0800 Subject: [PATCH] doc refactor: readline --- doc/api/readline.markdown | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/api/readline.markdown b/doc/api/readline.markdown index 9f9dbc255b..b5e02f45f6 100644 --- a/doc/api/readline.markdown +++ b/doc/api/readline.markdown @@ -1,4 +1,4 @@ -## Readline +# Readline To use this module, do `require('readline')`. Readline allows reading of a stream (such as STDIN) on a line-by-line basis. @@ -17,7 +17,7 @@ program to gracefully pause: i.pause(); }); -### rl.createInterface(input, output, completer) +## rl.createInterface(input, output, completer) Takes two streams and creates a readline interface. The `completer` function is used for autocompletion. When given a substring, it returns `[[substr1, @@ -35,6 +35,11 @@ Also `completer` can be run in async mode if it accepts two arguments: var readline = require('readline'), rl = readline.createInterface(process.stdin, process.stdout); +## Class: Interface + +The class that represents a readline interface with a stdin and stdout +stream. + ### rl.setPrompt(prompt, length) Sets the prompt, for example when you run `node` on the command line, you see @@ -48,8 +53,6 @@ options on a new line, giving the user a new spot to write. This will also resume the `in` stream used with `createInterface` if it has been paused. - - ### rl.question(query, callback) Prepends the prompt with `query` and invokes `callback` with the user's