diff options
author | isaacs <i@izs.me> | 2011-10-20 10:00:15 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-10-21 13:02:49 -0700 |
commit | 2d02e6a992087d2e2c3d096ebb562f7938130914 (patch) | |
tree | b7cf6bb20b486c2eb763c965affb821936a579f7 /doc | |
parent | caf70f5e9419c307bc9f35c3062e9af8b7bf48ea (diff) | |
download | node-2d02e6a992087d2e2c3d096ebb562f7938130914.tar.gz |
Add useGlobal flag for standard node repl
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/repl.markdown | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/api/repl.markdown b/doc/api/repl.markdown index c0b9789e1..1b8ce246a 100644 --- a/doc/api/repl.markdown +++ b/doc/api/repl.markdown @@ -27,12 +27,15 @@ For example, you could add this to your bashrc file: alias node="env NODE_NO_READLINE=1 rlwrap node" -### repl.start(prompt='> ', stream=process.stdin, eval=eval) +### repl.start(prompt='> ', stream=process.stdin, eval=eval, useGlobal=false) Starts a REPL with `prompt` as the prompt and `stream` for all I/O. `prompt` is optional and defaults to `> `. `stream` is optional and defaults to `process.stdin`. `eval` is optional too and defaults to async wrapper for `eval`. +If `useGlobal` is set to true, then the repl will use the global object, +instead of running scripts in a separate context. + You can use your own `eval` function if it has following signature: function eval(cmd, callback) { |