PHP 8.2.30
Preview: index.js Size: 918 B
/opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules.bundled/npm-audit-report/lib/index.js

'use strict'

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

const exitCode = require('./exit-code.js')

module.exports = Object.assign((data, options = {}) => {
  const {
    reporter = 'install',
    color = true,
    unicode = true,
    indent = 2,
  } = options

  // CLI defaults this to `null` so the defaulting method above doesn't work
  const auditLevel = options.auditLevel || 'low'

  if (!data) {
    throw Object.assign(
      new TypeError('ENOAUDITDATA'),
      {
        code: 'ENOAUDITDATA',
        message: 'missing audit data',
      }
    )
  }

  if (typeof data.toJSON === 'function') {
    data = data.toJSON()
  }

  return {
    report: reporters[reporter](data, { color, unicode, indent }),
    exitCode: exitCode(data, auditLevel),
  }
}, { reporters })

Directory Contents

Dirs: 1 × Files: 3

Name Size Perms Modified Actions
reporters DIR
- drwxr-xr-x 2024-03-03 22:54:11
Edit Download
744 B lrw-r--r-- 2023-12-06 18:07:51
Edit Download
419 B lrw-r--r-- 2023-12-06 18:07:51
Edit Download
918 B lrw-r--r-- 2023-12-06 18:07:51
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).