projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4129305
)
Documented repl.scope for explicitly exposing variables within the repl.
author
simonw
<simon@simonwillison.net>
Tue, 24 Nov 2009 11:13:21 +0000
(
04:13
-0700)
committer
Ryan Dahl
<ry@tinyclouds.org>
Fri, 27 Nov 2009 22:02:13 +0000
(23:02 +0100)
doc/api.txt
patch
|
blob
|
history
diff --git
a/doc/api.txt
b/doc/api.txt
index
8b439cc
..
ecc55a9
100644
(file)
--- 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