diff options
author | simonw <simon@simonwillison.net> | 2009-11-24 04:13:21 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-11-27 23:02:13 +0100 |
commit | 516874f4a151ad50004c9e7ec73885319519bcef (patch) | |
tree | cb6ce93f562a0af77f01ad4a56309c0735115939 | |
parent | 4129305b7cdfb6df9695225e62714ab6e80fccd3 (diff) | |
download | nodejs-516874f4a151ad50004c9e7ec73885319519bcef.tar.gz nodejs-516874f4a151ad50004c9e7ec73885319519bcef.tar.bz2 nodejs-516874f4a151ad50004c9e7ec73885319519bcef.zip |
Documented repl.scope for explicitly exposing variables within the repl.
-rw-r--r-- | doc/api.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/api.txt b/doc/api.txt index 8b439cc96..ecc55a972 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -1432,8 +1432,13 @@ tcp.createServer(function (c) { }).listen(5000); repl.start("simple tcp server> "); ------------------------------------ - - +The repl provides access to any variables in the global scope. You can expose a variable +to the repl explicitly by assigning it to the +repl.scope+ object: +------------------------------------ +var count = 5; +repl.start(); +repl.scope.count = count; +------------------------------------ == Addons |