This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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

  • Loading branch information...
ELLIOTTCABLE authored and ry committed Jan 5, 2010
1 parent 04dd2d5 commit 52f088b966dad8a617f0cd3b41e833dcf111f992
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/repl.js
View
@@ -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);
}
}

1 comment on commit 52f088b

@cloudhead

This comment has been minimized.

Show comment
Hide comment
@cloudhead

cloudhead Jan 15, 2010

nice, thanks.

cloudhead commented on 52f088b Jan 15, 2010

nice, thanks.

Please sign in to comment.