Line#output calls process.stdout.write with an added new line. This causes, at least on Windows, there to be two new lines after every line because process.stdout.write outputs with a new line already. Could this excess new line either be removed or be controlled by an option for if it's there or not?
For instance, the constructor for Line could be:
// Chainable wrapper for line content
Line: function (defaultBuffer, opts) {
var lineContent = "";
var self = this;
if (defaultBuffer instanceof helpers.LineBuffer) {
self.defaultBuffer = defaultBuffer;
}
// Allow the user to send in options as the first argument if they aren't
// supplying a default buffer.
self.options = self.defaultBuffer ?
opts:
defaultBuffer;
self.options = self.options || {};
// Default new line option to true to maintain old behavior.
if (!self.options.hasOwnProperty('newLine')) {
self.options.newLine = true;
}
And then the output could look like:
// Output a line directly to the screen.
this.output = function () {
process.stdout.write(lineContent + (self.options.newLine ? '\n' : ''));
return self;
};
I'm not sure which way you want to go with this, but I would love the ability to suppress that newline. I'm happy to created a pull request for it if you want, once you specify which way you want to go with things.
Line#output calls
process.stdout.write
with an added new line. This causes, at least on Windows, there to be two new lines after every line becauseprocess.stdout.write
outputs with a new line already. Could this excess new line either be removed or be controlled by an option for if it's there or not?For instance, the constructor for
Line
could be:And then the output could look like:
I'm not sure which way you want to go with this, but I would love the ability to suppress that newline. I'm happy to created a pull request for it if you want, once you specify which way you want to go with things.