Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Opts

Index

Properties

Optional --

--: boolean

When true, populate argv._ with everything before the -- and argv['--'] with everything after the --. Note that with -- set, parsing for arguments still stops after the --.

Optional alias

alias: {}

An object mapping string names to strings or arrays of string argument names to use as aliases

Type declaration

  • [key: string]: string | string[]

Optional boolean

boolean: string | boolean | string[]

A boolean, string or array of strings to always treat as booleans. If true will treat all double hyphenated arguments without equals signs as boolean (e.g. affects --foo, not -f or --foo=bar)

Optional default

default: {}

An object mapping string argument names to default values

Type declaration

  • [key: string]: any

Optional stopEarly

stopEarly: boolean

When true, populate argv._ with everything after the first non-option

Optional string

string: string | string[]

A string or array of strings argument names to always treat as strings

Optional unknown

unknown: (arg: string) => boolean

Type declaration

    • (arg: string): boolean
    • A function which is invoked with a command line parameter not defined in the opts configuration object. If the function returns false, the unknown option is not added to argv

      Parameters

      • arg: string

      Returns boolean