summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJeremiah Senkpiel <fishrock123@rocketmail.com>2015-08-03 23:33:48 -0700
committerRod Vagg <rod@vagg.org>2015-08-04 11:56:18 -0700
commit1721968b22146940701324db53590af286c45c7e (patch)
tree0eecf609e45a671fba98c6677952bbce1c9d3f54 /doc
parentd20093246bc1666ad0ad52d757cad1730ad69b2f (diff)
downloadandroid-node-v8-1721968b22146940701324db53590af286c45c7e.tar.gz
android-node-v8-1721968b22146940701324db53590af286c45c7e.tar.bz2
android-node-v8-1721968b22146940701324db53590af286c45c7e.zip
doc: document repl persistent history changes
PR-URL: https://github.com/nodejs/io.js/pull/2224 Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com> Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/repl.markdown31
1 files changed, 23 insertions, 8 deletions
diff --git a/doc/api/repl.markdown b/doc/api/repl.markdown
index 551a70b279..8c992b3c9a 100644
--- a/doc/api/repl.markdown
+++ b/doc/api/repl.markdown
@@ -29,23 +29,38 @@ For example, you could add this to your bashrc file:
alias iojs="env NODE_NO_READLINE=1 rlwrap iojs"
+### Persistent History
+
+By default, the REPL will persist history between `iojs` REPL sessions by saving
+to a `.node_repl_history` file in the user's home directory. This can be
+disabled by setting the environment variable `NODE_REPL_HISTORY=""`.
+
+Previously in io.js v2.x, REPL history was controlled by using a
+`NODE_REPL_HISTORY_FILE` environment variable, and the history was saved in JSON
+format. This variable has now been deprecated, and your REPL history will
+automatically be converted to using plain text. The new file will be saved to
+either your home directory, or a directory defined by the `NODE_REPL_HISTORY`
+variable, as documented below.
+
+### Environment Variable Options
+
The built-in repl (invoked by running `iojs` or `iojs -i`) may be controlled
via the following environment variables:
- - `NODE_REPL_HISTORY_FILE` - if given, must be a path to a user-writable,
- user-readable file. When a valid path is given, persistent history support
- is enabled: REPL history will persist across `iojs` repl sessions.
- - `NODE_REPL_HISTORY_SIZE` - defaults to `1000`. In conjunction with
- `NODE_REPL_HISTORY_FILE`, controls how many lines of history will be
- persisted. Must be a positive number.
+ - `NODE_REPL_HISTORY` - When a valid path is given, persistent REPL history
+ will be saved to the specified file rather than `.node_repl_history` in the
+ user's home directory. Setting this value to `""` will disable persistent
+ REPL history.
+ - `NODE_REPL_HISTORY_SIZE` - defaults to `1000`. Controls how many lines of
+ history will be persisted if history is available. Must be a positive number.
- `NODE_REPL_MODE` - may be any of `sloppy`, `strict`, or `magic`. Defaults
to `magic`, which will automatically run "strict mode only" statements in
strict mode.
## repl.start(options)
-Returns and starts a `REPLServer` instance, that inherits from
-[Readline Interface][]. Accepts an "options" Object that takes
+Returns and starts a `REPLServer` instance, that inherits from
+[Readline Interface][]. Accepts an "options" Object that takes
the following values:
- `prompt` - the prompt and `stream` for all I/O. Defaults to `> `.