summaryrefslogtreecommitdiff
path: root/doc/api/readline.md
diff options
context:
space:
mode:
authorDanny Nemer <hi@DannyNemer.com>2015-09-21 10:08:36 -0400
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2017-03-17 17:01:32 -0400
commit5bda5faffdeefa448965159e524eacdd14490436 (patch)
tree9c6402385483d477c06e83e5fc84255f2f5e9d07 /doc/api/readline.md
parentdf69d95b764c06a8ed140357b9a4078ef7322d9c (diff)
downloadandroid-node-v8-5bda5faffdeefa448965159e524eacdd14490436.tar.gz
android-node-v8-5bda5faffdeefa448965159e524eacdd14490436.tar.bz2
android-node-v8-5bda5faffdeefa448965159e524eacdd14490436.zip
readline: add option to stop duplicates in history
Adds `options.deDupeHistory` for `readline.createInterface(options)`. If `options.deDupeHistory` is `true`, when a new input line being added to the history list duplicates an older one, removes the older line from the list. Defaults to `false`. Many users would appreciate this option, as it is a common setting in shells. This option certainly should not be default behavior, as it would be problematic in applications such as the `repl`, which inherits from the readline `Interface`. Extends documentation to reflect this API addition. Adds tests for when `options.deDupeHistory` is truthy, and when `options.deDupeHistory` is falsey. PR-URL: https://github.com/nodejs/node/pull/2982 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'doc/api/readline.md')
-rw-r--r--doc/api/readline.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/readline.md b/doc/api/readline.md
index 878721bb4d..e471daecae 100644
--- a/doc/api/readline.md
+++ b/doc/api/readline.md
@@ -370,6 +370,9 @@ changes:
`crlfDelay` milliseconds, both `\r` and `\n` will be treated as separate
end-of-line input. Default to `100` milliseconds.
`crlfDelay` will be coerced to `[100, 2000]` range.
+ * `deDupeHistory` {boolean} If `true`, when a new input line added to the
+ history list duplicates an older one, this removes the older line from the
+ list. Defaults to `false`.
The `readline.createInterface()` method creates a new `readline.Interface`
instance.