How to use the @parcel/logger.default.color function in @parcel/logger

To help you get started, we’ve selected a few @parcel/logger 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 parcel-bundler / parcel / packages / core / utils / src / pipeSpawn.js View on Github external
function pipeSpawn(cmd, params, opts) {
  const cp = spawn(
    cmd,
    params,
    Object.assign(
      {
        env: Object.assign(
          {
            FORCE_COLOR: logger.color,
            npm_config_color: logger.color ? 'always' : '',
            npm_config_progress: true
          },
          process.env
        )
      },
      opts
    )
  );

  cp.stdout.setEncoding('utf8').on('data', d => logger.writeRaw(d));
  cp.stderr.setEncoding('utf8').on('data', d => logger.writeRaw(d));

  return new Promise((resolve, reject) => {
    cp.on('error', reject);
    cp.on('close', function(code) {
github parcel-bundler / parcel / packages / core / utils / src / pipeSpawn.js View on Github external
function pipeSpawn(cmd, params, opts) {
  const cp = spawn(
    cmd,
    params,
    Object.assign(
      {
        env: Object.assign(
          {
            FORCE_COLOR: logger.color,
            npm_config_color: logger.color ? 'always' : '',
            npm_config_progress: true
          },
          process.env
        )
      },
      opts
    )
  );

  cp.stdout.setEncoding('utf8').on('data', d => logger.writeRaw(d));
  cp.stderr.setEncoding('utf8').on('data', d => logger.writeRaw(d));

  return new Promise((resolve, reject) => {
    cp.on('error', reject);
    cp.on('close', function(code) {
      if (code !== 0) {