Documented repl.scope for explicitly exposing variables within the repl.

pull/23362/head
simonw 2009-11-24 04:13:21 -07:00 committed by Ryan Dahl
parent 4129305b7c
commit 516874f4a1
1 changed files with 7 additions and 2 deletions

View File

@ -1432,8 +1432,13 @@ tcp.createServer(function (c) {
}).listen(5000); }).listen(5000);
repl.start("simple tcp server> "); 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 == Addons