0x/lib/preload/redir-stdout.js
Renée Kooi 0fdd418274
Change process.stdout switcharoo to a full net.Socket instance
No matter how you write to stdout, this should catch it!
The `defineProperty` call uses the same options as the default `process.stdout`.
2018-08-24 13:25:11 +02:00

14 lines
229 B
JavaScript

'use strict'
const net = require('net')
const socket = new net.Socket({
fd: 3,
readable: false,
writable: true
})
Object.defineProperty(process, 'stdout', {
configurable: true,
enumerable: true,
get: () => socket
})