// get the log file a given job. id passed as query param app.get(routes.stdout, function(req, res) { let _file = crontab.log_folder + "/" + req.query.id + ".stdout.log"; sendLog(_file, req, res); });
initialize() { this.rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: false, }); this.rl.on('line', async (line) => this.hear(line)); }
restore() { if (this.state.closed || this.options.show === false) return; let { prompt, after, rest } = this.sections(); let { cursor, initial = '', input = '', value = '' } = this; let size = this.state.size = rest.length; let state = { after, cursor, initial, input, prompt, size, value }; let codes = ansi.cursor.restore(state); if (codes) { this.stdout.write(codes); } }
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') })
test('space option with boolean strings', async t => { const cwd = path.join(__dirname, 'fixtures/space'); const trueResult = await t.throwsAsync(main(['--space=true'], {cwd})); const falseResult = await t.throwsAsync(main(['--space=false'], {cwd})); t.true(trueResult.stdout.includes('Expected indentation of 2 spaces')); t.true(falseResult.stdout.includes('Expected indentation of 1 tab')); });
const exec = (cmd, args) => { // Use `Observable` support if merged https://github.com/sindresorhus/execa/pull/26 const cp = execa(cmd, args); return merge( streamToObservable(cp.stdout.pipe(split())), streamToObservable(cp.stderr.pipe(split())), cp ).pipe(filter(Boolean)); }
writeTerminalData(stream, data) { const buffer = Buffer.from(data, 'base64'); if (stream === 'stderr') process.stderr.write(buffer); else if (stream === 'stdout') process.stdout.write(buffer); }
const consumerGroupDescribe = containerId => { const cmd = ` docker exec \ ${containerId} \ bash -c "JMX_PORT=9998 kafka-consumer-groups --bootstrap-server kafka1:9092 --group test-group-${secureRandom()} --describe > /dev/null 2>&1" sleep 1 ` return execa.commandSync(cmd, { shell: true }).stdout.toString('utf-8') }
test('you can write to child.stdin', async t => { const subprocess = execa('stdin'); subprocess.stdin.end('unicorns'); t.is((await subprocess).stdout, 'unicorns'); });
const listDependencies = function () { if (depsCache !== undefined) return depsCache const rawDeps = spawnSync('npm', ['list', '--json']) depsCache = JSON.parse(rawDeps.stdout) return depsCache }
test('ignores `undefined` from prettifier', async ({ is }) => { var actual = '' const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'skipped-output.js')]) child.stdout.pipe(writer((s, enc) => { actual += s })) await once(child, 'close') is(actual, '') })