Skip to content

Commit 52f088b

Browse files
ELLIOTTCABLEry
authored andcommitted
Providing the option for a repl-printer other than sys.p
1 parent 04dd2d5 commit 52f088b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/repl.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ var scopeFunc = /^\s*function\s*([_\w\$]+)/;
1010

1111
exports.scope = {};
1212
exports.prompt = "node> ";
13+
// Can overridden with custom print functions, such as `probe` or `eyes.js`
14+
exports.writer = sys.p;
1315
exports.start = function (prompt) {
1416
if (prompt !== undefined) {
1517
exports.prompt = prompt;
@@ -46,7 +48,7 @@ function readline (cmd) {
4648
var ret = eval(buffered_cmd);
4749
if (ret !== undefined) {
4850
exports.scope['_'] = ret;
49-
sys.p(ret);
51+
exports.writer(ret);
5052
}
5153
}
5254

0 commit comments

Comments
 (0)