src/lib/stream.js
/**
 * Prints an error in red and error stack below it.
 * data[error]
 * data[error][stack]
 * data[stack]
 * data[name]
 */
Prints an error in red and error stack below it.
Prints an error in red and error stack below it .
function createErrorTransformStream() {
  const ts = new Transform( ({
    objectMode: true,
    transform({ error, stack, name }, encoding, callback) {
      if (!error) {
        return callback()
      }
      this.push('\x1b[31m')
      this.push(stack.join(' > '))
      this.push(` > ${name}`)
      this.push('\x1b[0m')
      this.push(EOL)
      this.push(indent(filterStack({ error, name }), '  '))
      this.push(EOL)
      this.push(EOL)
      callback()
    },
  }))
  return ts
}
function createErrorTransformStream ( ) { const ts = new Transform ( ( { objectMode : true , transform ( { error , stack , name } , encoding , callback ) { if ( ! error ) { return callback ( ) } this . push ( '\x1b[31m' ) this . push ( stack . join ( ' > ' ) ) this . push ( ` ${ name } ` ) this . push ( '\x1b[0m' ) this . push ( EOL ) this . push ( indent ( filterStack ( { error , name } ) , '  ' ) ) this . push ( EOL ) this . push ( EOL ) callback ( ) } , } ) ) return ts }
Prints an error in red and error stack below it.
Prints an error in red and error stack below it .
/** @type {!stream.TransformOptions} */