403Webshell
Server IP : 14.225.204.176  /  Your IP : 216.73.216.6
Web Server : nginx/1.24.0
System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64
User : root ( 0)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/node_modules/nyc/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/node_modules/nyc/lib/config-util.js
'use strict'

const path = require('path')
const findUp = require('find-up')
const Yargs = require('yargs/yargs')

const { setupOptions } = require('./commands/helpers')
const processArgs = require('./process-args')
const { loadNycConfig } = require('@istanbuljs/load-nyc-config')

async function guessCWD (cwd) {
  cwd = cwd || process.env.NYC_CWD || process.cwd()
  const pkgPath = await findUp('package.json', { cwd })
  if (pkgPath) {
    cwd = path.dirname(pkgPath)
  }

  return cwd
}

async function processConfig (cwd) {
  cwd = await guessCWD(cwd)
  const yargs = Yargs([])
    .usage('$0 [command] [options]')
    .usage('$0 [options] [bin-to-instrument]')
    .showHidden(false)

  setupOptions(yargs, null, cwd)

  yargs
    .example('$0 npm test', 'instrument your tests with coverage')
    .example('$0 --require @babel/register npm test', 'instrument your tests with coverage and transpile with Babel')
    .example('$0 report --reporter=text-lcov', 'output lcov report after running your tests')
    .epilog('visit https://git.io/vHysA for list of available reporters')
    .boolean('h')
    .boolean('version')
    .help(false)
    .version(false)

  const instrumenterArgs = processArgs.hideInstrumenteeArgs()

  // This yargs.parse must come before any options that exit post-hoc
  const childArgs = processArgs.hideInstrumenterArgs(yargs.parse(process.argv.slice(2)))
  const config = await loadNycConfig(yargs.parse(instrumenterArgs))

  yargs
    .config(config)
    .help('h')
    .alias('h', 'help')
    .version()
    .command(require('./commands/check-coverage'))
    .command(require('./commands/instrument'))
    .command(require('./commands/report'))
    .command(require('./commands/merge'))

  return {
    get argv () {
      return yargs.parse(instrumenterArgs)
    },
    childArgs,
    yargs
  }
}

module.exports = processConfig

Youez - 2016 - github.com/yon3zu
LinuXploit