mirror of https://github.com/nodejs/node.git
Documented repl.scope for explicitly exposing variables within the repl.
parent
4129305b7c
commit
516874f4a1
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue