Skip to content

Commit 3352e6e

Browse files
committed
doc: add replServer.setupHistory() to documentation
1 parent becf843 commit 3352e6e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

doc/api/repl.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,22 @@ deprecated: v9.0.0
448448
An internal method used to parse and execute `REPLServer` keywords.
449449
Returns `true` if `keyword` is a valid keyword, otherwise `false`.
450450

451+
### replServer.setupHistory(historyPath, callback)
452+
<!-- YAML
453+
added: REPLACEME
454+
-->
455+
456+
* `historyPath` {string} the path to the history file
457+
* `callback` {Function} called when history writes are ready or upon error
458+
* `err` {Error}
459+
* `repl` {repl.REPLServer}
460+
461+
Initializes a history log file for the REPL instance. When executing the
462+
Node.js binary and using the command line REPL, a history file is initialized
463+
by default. However, this is not the case when creating a REPL
464+
programmatically. Use this method to initialize a history log file when working
465+
with REPL instances programmatically.
466+
451467
## repl.start([options])
452468
<!-- YAML
453469
added: v0.1.91

0 commit comments

Comments
 (0)