src/lib/index.js
function defaultTransformer(...args) {
  try {
    let [record, ...rest] = args
    try {
      record = typeof record === 'string' ? JSON.parse(record) : record
    } catch(err) {
      return { type: 'bunyan', record: { err: new Error('Could not parse message.') } }
    }
    return { type: 'bunyan', record }
  } catch(err) {
    return { type: 'bunyan', record: { err: new Error('Internal error occurred.')}}
  }
}
function defaultTransformer(...args) {
  try {
    let [record, ...rest] = args
    try {
      record = typeof record === 'string' ? JSON.parse(record) : record
    } catch(err) {
      return { type: 'bunyan', record: { err: new Error('Could not parse message.') } }
    }
    return { type: 'bunyan', record }
  } catch(err) {
    return { type: 'bunyan', record: { err: new Error('Internal error occurred.')}}
  }
}
defaultTransformer takes arguments from a bunyan WritableStream's write method and formats output in a standard way that can be interpreted by parent process.
@param  {...Object} args - args that were passed to WritableStream.prototype.write()
@return {Object}           Object to pass through IPC communication channel to parent process.