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

Version Path
immosquare-cleaner-0.1.62 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.61 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.60 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.59 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.58 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.57 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.56 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.55 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.54 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.53 node_modules/has-flag/index.d.ts
immosquare-cleaner-0.1.52 node_modules/has-flag/index.d.ts
trusty-cms-6.3.1 node_modules/log-symbols/node_modules/has-flag/index.d.ts
trusty-cms-6.3.1 node_modules/stylelint/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