Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createWritableStdioStream(fd) {
var tty = require('tty');
var stream = new tty.WriteStream(fd);
stream._type = 'tty';
if (stream._handle && stream._handle.unref) {
stream._handle.unref();
}
stream.fd = fd;
stream._isStdio = true;
return stream;
}
get: function() {
if (!this._stdout) {
if ( this.terminal ) {
this._stdout = new tty.WriteStream( this.terminal );
} else {
this._stdout = new streams.OutputStream( System.out );
}
this._stdout._start();
}
return this._stdout;
}
});