has-flag
Check if
argv
has a specific flag
Correctly stops looking after an --
argument terminator.
Install
Usage
API
hasFlag(flag, [argv])
Returns a boolean for whether the flag exists.
flag
Type: string
CLI flag to look for. The --
prefix is optional.
argv
Type: string[]
Default: process.argv
CLI arguments.
License
MIT © Sindre Sorhus
Last updated