Sha256: 1f2e0d7173b86a8a84c9a6acd319b89d48e1411b5024e6eb03dc1551b30f392d

Contents?: true

Size: 684 Bytes

Versions: 140

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

140 entries across 138 versions & 13 rubygems

Version Path
trusty-cms-6.3.1 node_modules/stylelint/node_modules/has-flag/index.d.ts
trusty-cms-6.3.1 node_modules/log-symbols/node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.51 node_modules/has-flag/index.d.ts
clapton-0.0.26 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.50 node_modules/has-flag/index.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.49 node_modules/has-flag/index.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.48 node_modules/has-flag/index.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/has-flag/index.d.ts