writeTerminalData(stream, data) { const buffer = Buffer.from(data, 'base64'); if (stream === 'stderr') process.stderr.write(buffer); else if (stream === 'stdout') process.stdout.write(buffer); }
webpack(webpackConfig, function (err, stats) { spinner.stop() if (err) throw err process.stdout.write(stats.toString({ colors: true, modules: false, children: false, chunks: false, chunkModules: false }) + '\n') })
_onTestFinished(test) { if (test.result === 'ok') process.stdout.write(`${GREEN_COLOR}.${RESET_COLOR}`); else if (test.result === 'skipped') process.stdout.write(`${YELLOW_COLOR}*${RESET_COLOR}`); else if (test.result === 'failed') process.stdout.write(`${RED_COLOR}F${RESET_COLOR}`); else if (test.result === 'timedout') process.stdout.write(`${RED_COLOR}T${RESET_COLOR}`); }
test('pino.extreme() defaults to stdout', async ({ is }) => { const pino = require('..') process.removeAllListeners('warning') const dest = pino.extreme() is(dest.fd, process.stdout.fd) })
function test (file) { file = join('fixtures', 'broken-pipe', file) t.test(file, { parallel: true }, async ({ is }) => { const child = fork(join(__dirname, file), { silent: true }) child.stdout.destroy() child.stderr.pipe(process.stdout) const res = await once(child, 'close') is(res, 0) // process exits successfully }) }
command.stderr.on('data', data => { data = (data || '').toString(); data = data.split('\n').map(d => `[${type}${n ? ' ' + n : ''}] ${d}`).join('\n'); process.stdout.write(data + '\n'); });