• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict'
2
3const reporters = {
4  install: require('./reporters/install'),
5  parseable: require('./reporters/parseable'),
6  detail: require('./reporters/detail'),
7  json: require('./reporters/json'),
8  quiet: require('./reporters/quiet')
9}
10
11const report = function (data, options) {
12  const defaults = {
13    reporter: 'install',
14    withColor: true,
15    withUnicode: true
16  }
17
18  const config = Object.assign({}, defaults, options)
19  return new Promise((resolve) => {
20    const result = reporters[config.reporter](data, config)
21    return resolve(result)
22  })
23}
24
25module.exports = report
26