How to use the process.stderr function in process

To help you get started, we’ve selected a few process examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github versatica / mediasoup-client / npm-scripts.js View on Github external
function execute(command)
{
	// eslint-disable-next-line no-console
	console.log(`npm-scripts.js [INFO] executing command: ${command}`);

	try
	{
		execSync(command,	{ stdio: [ 'ignore', process.stdout, process.stderr ] });
	}
	catch (error)
	{
		process.exit(1);
	}
}
github feater-dev / feater / server / src / main.ts View on Github external
async function bootstrap() {
    const app: INestApplication = await NestFactory.create(ApplicationModule);

    app.use(
        morgan('dev', {
            skip: (req, res) => {
                return res.statusCode < 400;
            },
            stream: process.stderr,
        }),
    );

    app.use(
        morgan('dev', {
            skip: (req, res) => {
                return res.statusCode >= 400;
            },
            stream: process.stdout,
        }),
    );

    // TODO Get port from recipe.
    await app.listen(3000);
}
github raghur / mermaid-filter / index.js View on Github external
pandoc.toJSONFilter(function(type, value, format, meta) {
    // redirect stderr to file - if it logs to stdout, then pandoc hangs due to improper json
    errFile = path.join(folder,  "mermaid-filter.err");
    errorLog = fs.createWriteStream(errFile);
    var origStdErr = process.stderr.write;
    process.stderr.write = errorLog.write.bind(errorLog);
    return mermaid(type, value, format, meta);
});
github ondras / cfo / tests / index.js View on Github external
};

	for (let file in tests) {
		let t = tests[file];
		process.stdout.write(`${file}: `);
		for (let test of t) {
			child_process.execSync(`mkdir -p "${tmp}"`);
			try {
				await test(tmp);
				stats.passed++;
				process.stdout.write(".");
			} catch (e) {
				stats.failed++;
				process.stdout.write("F\n");
				process.stderr.write(`${test.name}: ${e}\n`);
				process.stderr.write(`${e.stack}\n`);
			} finally {
				child_process.execSync(`rm -rf "${tmp}"`);
			}
		}
		process.stdout.write("\n");
	}

	stats.asserts = utils.assert.callCount;
	return stats;
}
github apmjs / apmjs / test / stub / workspace.js View on Github external
return new Promise((resolve, reject) => {
    var child = exec(cmd, (err, stdout, stderr) => {
      err ? reject(err) : resolve({ stdout, stderr })
    })
    child.stdout.pipe(process.stdout)
    child.stderr.pipe(process.stderr)
  })
}
github jonathaneunice / iterm2-tab-set / util.js View on Github external
function errorExit () {
  var msg = _.toArray(arguments).join(' ') + '\n'
  process.stderr.write(msg)
  process.exit(1)
}
github uber-archive / hyperbahn / benchmarks / index.js View on Github external
function spawnMultibahnProc(procOpts) {
    var self = this;

    var hyperbahnMultiProc = self.run(multiBahn, procOpts);
    var relayIndex = self.relayProcs.length;
    self.relayProcs.push(hyperbahnMultiProc);
    hyperbahnMultiProc.stdout.pipe(process.stderr);
    hyperbahnMultiProc.stderr.pipe(process.stderr);
    return relayIndex;
};
github microsoft / azure-pipelines-tasks / Tasks / PublishBuildArtifacts / publishbuildartifacts.ts View on Github external
powershell.on('stderr', (buffer: Buffer) => {
                    process.stderr.write(buffer);
                });
                let execOptions = { silent: true } as tr.IExecOptions;
github replicatedhq / ship / hack / docs / src / merge.ts View on Github external
export const handler = (argv) => {
  process.stderr.write("merge-mutations\n");
  const schema = JSON.parse(fs.readFileSync(argv.infile).toString());
  const mutations: Mutation[] = JSON.parse(fs.readFileSync(argv.mutations).toString());

  for (const mutation of mutations) {
    process.stderr.write(`mutation for path ${mutation.path}\n`);

    let target = mutation.path ? _.get(schema, mutation.path) : schema;
    if (!target) {
      throw new Error(`no target found for path ${mutation.path}`)
    }

    if (mutation.merge) {
      target = _.merge(mutation.merge, target);
      _.set(schema, mutation.path, target);
    }

    if (mutation.replace) {
      for (const replacePath of Object.keys(mutation.replace)) {
        _.set(target, replacePath, mutation.replace[replacePath])
      }
      _.set(schema, mutation.path, target);
github Shopify / theme-lint / reporter.js View on Github external
  constructor(outputStream = require("process").stderr) {
    this.outputStream = outputStream;
    this.successes = [];
    this.failures = [];
  }