Home / Function/ parseArgs() — react Function Reference

parseArgs() — react Function Reference

Architecture documentation for the parseArgs() function in enable-feature-flag.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ae108147_61d1_61f8_7133_384ffd3e340b["parseArgs()"]
  fdb06a3a_b735_af93_2b10_31380c21c8b7["enable-feature-flag.js"]
  ae108147_61d1_61f8_7133_384ffd3e340b -->|defined in| fdb06a3a_b735_af93_2b10_31380c21c8b7
  ab68ec04_512e_f89e_9e49_ae73608023f0["main()"]
  ab68ec04_512e_f89e_9e49_ae73608023f0 -->|calls| ae108147_61d1_61f8_7133_384ffd3e340b
  style ae108147_61d1_61f8_7133_384ffd3e340b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/scripts/enable-feature-flag.js lines 32–51

function parseArgs() {
  const argv = yargs(hideBin(process.argv))
    .usage('Usage: $0 <flag-name>')
    .command('$0 <flag-name>', 'Enable a feature flag by default', yargs => {
      yargs.positional('flag-name', {
        describe: 'Name of the feature flag to enable',
        type: 'string',
      });
    })
    .example(
      '$0 validateExhaustiveMemoizationDependencies',
      'Enable the validateExhaustiveMemoizationDependencies flag'
    )
    .help('h')
    .alias('h', 'help')
    .strict()
    .parseSync();

  return argv['flag-name'];
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does parseArgs() do?
parseArgs() is a function in the react codebase, defined in compiler/scripts/enable-feature-flag.js.
Where is parseArgs() defined?
parseArgs() is defined in compiler/scripts/enable-feature-flag.js at line 32.
What calls parseArgs()?
parseArgs() is called by 1 function(s): main.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free