summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-audit-report/index.js
blob: 2e0f21abb783f9d2e7276d96c93067d5a1a278d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict'

const reporters = {
  install: require('./reporters/install'),
  detail: require('./reporters/detail'),
  json: require('./reporters/json'),
  quiet: require('./reporters/quiet')
}

const report = function (data, options) {
  const defaults = {
    reporter: 'install',
    withColor: true,
    withUnicode: true
  }

  const config = Object.assign({}, defaults, options)
  return new Promise((resolve, reject) => {
    const result = reporters[config.reporter](data, config)
    return resolve(result)
  })
}

module.exports = report