Files
react-native-devtools-frontend/node_modules/has-flag
Tim van der Lippe 8aaca9e8f1 Update node_modules to include typescript-eslint
DISABLE_THIRD_PARTY_CHECK=Updates package.json

Bug: 1041811
Change-Id: I9493880aed334f02e5899efed3fc8bb964d0bbb0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1998770
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-14 13:05:28 +00:00
..
2019-10-21 08:08:56 +02:00
2019-12-02 14:54:54 +00:00
2019-10-21 08:08:56 +02:00

has-flag Build Status

Check if argv has a specific flag

Correctly stops looking after an -- argument terminator.

Install

$ npm install has-flag

Usage

// foo.js
const 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
$ node foo.js -f --unicorn --foo=bar -- --rainbow

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