Sha256: 1f2e0d7173b86a8a84c9a6acd319b89d48e1411b5024e6eb03dc1551b30f392d
Contents?: true
Size: 684 Bytes
Versions: 131
Compression:
Stored size: 684 Bytes
Contents
/** Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. @param flag - CLI flag to look for. The `--` prefix is optional. @param argv - CLI arguments. Default: `process.argv`. @returns Whether the flag exists. @example ``` // $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow // foo.ts import hasFlag = require('has-flag'); hasFlag('unicorn'); //=> true hasFlag('--unicorn'); //=> true hasFlag('f'); //=> true hasFlag('-f'); //=> true hasFlag('foo=bar'); //=> true hasFlag('foo'); //=> false hasFlag('rainbow'); //=> false ``` */ declare function hasFlag(flag: string, argv?: string[]): boolean; export = hasFlag;
Version data entries
131 entries across 129 versions & 12 rubygems