eyes.js
eyes.js copied to clipboard
Option to not add newline
I'd like to be able to print stuff inline like a sentence. Here's a snippet of my setup code:
var eyes = require('eyes');
var eyes_err = eyes.inspector({stream: process.stderr, maxLength: 1024*1024});
// stdout with a newline
function l(){console.log.apply(console,arguments)}
// uses eyes to send pretty output to stderr
function e() {
for (var i=0; i<arguments.length; ++i) {
if (typeof arguments[i] === 'string') {
process.stderr.write(arguments[i] + " ");
} else {
eyes_err(arguments[i]);
}
}
process.stderr.write("\n");
}
This gets me almost there but if I do
e("here is the data", {data: 23}, "and I am done now")
It prints a newline before "and I am done now" which is undesired. I'd in addition prefer for it to let me specify that instead of ending with a newline I actually want it to use a space.
I suspect line 76:
this.stylize(str, options.styles.all, options.styles) + '\033[0m' + "\n");
may perhaps be where this change might happen???