Browse Source

doc: extra clarification of historySize option

History caching in the `readline` io is active only for terminal
interaction. Appropriate variables are initialized and relevant
`_addHistory()` function is called only if exposed `terminal` option
of `readline.createInterface()` is set `true` by user or internal
output check.

This clarification is useful to assure users there will be now wasted
overhead connected with history caching if `readline` is used not
for terminal interaction (e.g. for reading files line by line).

Particularly this fix is helpful after #6352 landing.

PR-URL: https://github.com/nodejs/node/pull/6397
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Alexander Makarenko <estliberitas@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
v6.x
vsemozhetbyt 9 years ago
committed by Jeremiah Senkpiel
parent
commit
13e660888f
  1. 4
      doc/api/readline.md

4
doc/api/readline.md

@ -301,7 +301,9 @@ the following values:
Defaults to checking `isTTY` on the `output` stream upon instantiation.
- `historySize` - maximum number of history lines retained. To disable the
history set this value to `0`. Defaults to `30`.
history set this value to `0`. Defaults to `30`. This option makes sense
only if `terminal` is set to `true` by the user or by an internal `output`
check, otherwise the history caching mechanism is not initialized at all.
The `completer` function is given the current line entered by the user, and
is supposed to return an Array with 2 entries:

Loading…
Cancel
Save