Browse Source

Providing the option for a repl-printer other than sys.p

v0.7.4-release
elliottcable 15 years ago
committed by Ryan Dahl
parent
commit
52f088b966
  1. 4
      lib/repl.js

4
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);
}
}

Loading…
Cancel
Save