@@ -26,23 +26,35 @@ rl.question('What do you think of Node.js? ', (answer) => {
2626```
2727
2828## Class: Interface
29+ <!-- YAML
30+ added: v0.1.104
31+ -->
2932
3033The class that represents a readline interface with an input and output
3134stream.
3235
3336### rl.close()
37+ <!-- YAML
38+ added: v0.1.98
39+ -->
3440
3541Closes the ` Interface ` instance, relinquishing control on the ` input ` and
3642` output ` streams. The ` 'close' ` event will also be emitted.
3743
3844### rl.pause()
45+ <!-- YAML
46+ added: v0.3.4
47+ -->
3948
4049Pauses the readline ` input ` stream, allowing it to be resumed later if needed.
4150
4251Note that this doesn't immediately pause the stream of events. Several events may
4352be emitted after calling ` pause ` , including ` line ` .
4453
4554### rl.prompt([ preserveCursor] )
55+ <!-- YAML
56+ added: v0.1.98
57+ -->
4658
4759Readies readline for input from the user, putting the current ` setPrompt `
4860options on a new line, giving the user a new spot to write. Set ` preserveCursor `
@@ -55,6 +67,9 @@ If `output` is set to `null` or `undefined` when calling `createInterface`, the
5567prompt is not written.
5668
5769### rl.question(query, callback)
70+ <!-- YAML
71+ added: v0.3.3
72+ -->
5873
5974Prepends the prompt with ` query ` and invokes ` callback ` with the user's
6075response. Displays the query to the user, and then invokes ` callback `
@@ -75,15 +90,24 @@ rl.question('What is your favorite food?', (answer) => {
7590```
7691
7792### rl.resume()
93+ <!-- YAML
94+ added: v0.3.4
95+ -->
7896
7997Resumes the readline ` input ` stream.
8098
8199### rl.setPrompt(prompt)
100+ <!-- YAML
101+ added: v0.1.98
102+ -->
82103
83104Sets the prompt, for example when you run ` node ` on the command line, you see
84105` > ` , which is Node.js's prompt.
85106
86107### rl.write(data[ , key] )
108+ <!-- YAML
109+ added: v0.1.98
110+ -->
87111
88112Writes ` data ` to ` output ` stream, unless ` output ` is set to ` null ` or
89113` undefined ` when calling ` createInterface ` . ` key ` is an object literal to
@@ -102,6 +126,9 @@ rl.write(null, {ctrl: true, name: 'u'});
102126## Events
103127
104128### Event: 'close'
129+ <!-- YAML
130+ added: v0.1.98
131+ -->
105132
106133` function () {} `
107134
@@ -115,6 +142,9 @@ This event is also called if there is no `SIGINT` event listener present when
115142the ` input ` stream receives a ` ^C ` , respectively known as ` SIGINT ` .
116143
117144### Event: 'line'
145+ <!-- YAML
146+ added: v0.1.98
147+ -->
118148
119149` function (line) {} `
120150
@@ -131,6 +161,9 @@ rl.on('line', (cmd) => {
131161```
132162
133163### Event: 'pause'
164+ <!-- YAML
165+ added: v0.7.5
166+ -->
134167
135168` function () {} `
136169
@@ -148,6 +181,9 @@ rl.on('pause', () => {
148181```
149182
150183### Event: 'resume'
184+ <!-- YAML
185+ added: v0.7.5
186+ -->
151187
152188` function () {} `
153189
@@ -162,6 +198,9 @@ rl.on('resume', () => {
162198```
163199
164200### Event: 'SIGCONT'
201+ <!-- YAML
202+ added: v0.7.5
203+ -->
165204
166205` function () {} `
167206
@@ -182,6 +221,9 @@ rl.on('SIGCONT', () => {
182221```
183222
184223### Event: 'SIGINT'
224+ <!-- YAML
225+ added: v0.3.0
226+ -->
185227
186228` function () {} `
187229
@@ -200,6 +242,9 @@ rl.on('SIGINT', () => {
200242```
201243
202244### Event: 'SIGTSTP'
245+ <!-- YAML
246+ added: v0.7.5
247+ -->
203248
204249` function () {} `
205250
@@ -272,6 +317,9 @@ rl.on('line', (line) => {
272317```
273318
274319## readline.clearLine(stream, dir)
320+ <!-- YAML
321+ added: v0.7.7
322+ -->
275323
276324Clears current line of given TTY stream in a specified direction.
277325` dir ` should have one of following values:
@@ -281,10 +329,16 @@ Clears current line of given TTY stream in a specified direction.
281329* ` 0 ` - the entire line
282330
283331## readline.clearScreenDown(stream)
332+ <!-- YAML
333+ added: v0.7.7
334+ -->
284335
285336Clears the screen from the current position of the cursor down.
286337
287338## readline.createInterface(options)
339+ <!-- YAML
340+ added: v0.1.98
341+ -->
288342
289343Creates a readline ` Interface ` instance. Accepts an ` options ` Object that takes
290344the following values:
@@ -354,10 +408,16 @@ a `'resize'` event on the `output` if/when the columns ever change
354408([ ` process.stdout ` ] [ ] does this automatically when it is a TTY).
355409
356410## readline.cursorTo(stream, x, y)
411+ <!-- YAML
412+ added: v0.7.7
413+ -->
357414
358415Move cursor to the specified position in a given TTY stream.
359416
360417## readline.emitKeypressEvents(stream[ , interface] )
418+ <!-- YAML
419+ added: v0.7.7
420+ -->
361421
362422Causes ` stream ` to begin emitting ` 'keypress' ` events corresponding to its
363423input.
@@ -374,6 +434,9 @@ if (process.stdin.isTTY) {
374434```
375435
376436## readline.moveCursor(stream, dx, dy)
437+ <!-- YAML
438+ added: v0.7.7
439+ -->
377440
378441Move cursor relative to it's current position in a given TTY stream.
379442
0 commit comments