diff --git a/lib/repl.js b/lib/repl.js index 7b2c4d44d9..ee7dd9b61c 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -10,6 +10,8 @@ var scopeFunc = /^\s*function\s*([_\w\$]+)/; exports.scope = {}; exports.prompt = "node> "; +// Can overridden with custom print functions, such as `probe` or `eyes.js` +exports.writer = sys.p; exports.start = function (prompt) { if (prompt !== undefined) { exports.prompt = prompt; @@ -46,7 +48,7 @@ function readline (cmd) { var ret = eval(buffered_cmd); if (ret !== undefined) { exports.scope['_'] = ret; - sys.p(ret); + exports.writer(ret); } }