summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-04-15 02:03:12 +0200
committerJames M Snell <jasnell@gmail.com>2016-04-18 15:31:32 -0700
commit39d905e2937ab10040f45b0ab0707f8bd9bf86b9 (patch)
treee38cb49a02520613e24764d0e3f17559417704f4 /doc
parent15d970d65c8da7970e6bacb9feccb4b830376881 (diff)
downloadandroid-node-v8-39d905e2937ab10040f45b0ab0707f8bd9bf86b9.tar.gz
android-node-v8-39d905e2937ab10040f45b0ab0707f8bd9bf86b9.tar.bz2
android-node-v8-39d905e2937ab10040f45b0ab0707f8bd9bf86b9.zip
node: make builtin libs available for `--eval`
Make the builtin libraries available for the `--eval` and `--print` CLI options, using the same mechanism that the REPL uses. This renders workarounds like `node -e 'require("fs").doStuff()'` unnecessary. As part of this, the list of builtin modules and the code for adding the corresponding properties to the target context is moved to `internal/module.js`, and the previously missing `repl` entry is added. PR-URL: https://github.com/nodejs/node/pull/6207 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cli.markdown3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/cli.markdown b/doc/api/cli.markdown
index 52e3f2709c..e03773d1e7 100644
--- a/doc/api/cli.markdown
+++ b/doc/api/cli.markdown
@@ -36,7 +36,8 @@ The output of this option is less detailed than this document.
### `-e`, `--eval "script"`
-Evaluate the following argument as JavaScript.
+Evaluate the following argument as JavaScript. The modules which are
+predefined in the REPL can also be used in `script`.
### `-p`, `--print "script"`