Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

doc: add args for rl.write and rl.prompt

  • Loading branch information...
shama authored and bnoordhuis committed Apr 21, 2012
1 parent da56c72 commit 525253d50e0a1dbfe1a06c89d3a94e16bab2fcb8
Showing with 12 additions and 4 deletions.
  1. +12 −4 doc/api/readline.markdown
@@ -91,10 +91,11 @@ stream.
Sets the prompt, for example when you run `node` on the command line, you see
`> `, which is node's prompt.

### rl.prompt()
### rl.prompt([preserveCursor])

Readies readline for input from the user, putting the current `setPrompt`
options on a new line, giving the user a new spot to write.
options on a new line, giving the user a new spot to write. Set `preserveCursor`
to `true` to prevent the cursor placement being reset to `0`.

This will also resume the `input` stream used with `createInterface` if it has
been paused.
@@ -127,12 +128,19 @@ Resumes the readline `input` stream.
Closes the `Interface` instance, relinquishing control on the `input` and
`output` streams. The "close" event will also be emitted.

### rl.write()
### rl.write(data, [key])

Writes to `output` stream.
Writes `data` to `output` stream. `key` is an object literal to represent a key
sequence; available if the terminal is a TTY.

This will also resume the `input` stream if it has been paused.

Example:

rl.write('Delete me!');
// Simulate ctrl+u to delete the line written previously
rl.write(null, {ctrl: true, name: 'u'});

## Events

### Event: 'line'

0 comments on commit 525253d

Please sign in to comment.
You can’t perform that action at this time.