CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
readme.md90 linesDownload Raw Back to has-flag
1# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)2 3> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag4 5Correctly stops looking after an `--` argument terminator.6 7---8 9<div align="center">10	<b>11		<a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>12	</b>13	<br>14	<sub>15		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.16	</sub>17</div>18 19---20 21 22## Install23 24```25$ npm install has-flag26```27 28 29## Usage30 31```js32// foo.js33const hasFlag = require('has-flag');34 35hasFlag('unicorn');36//=> true37 38hasFlag('--unicorn');39//=> true40 41hasFlag('f');42//=> true43 44hasFlag('-f');45//=> true46 47hasFlag('foo=bar');48//=> true49 50hasFlag('foo');51//=> false52 53hasFlag('rainbow');54//=> false55```56 57```58$ node foo.js -f --unicorn --foo=bar -- --rainbow59```60 61 62## API63 64### hasFlag(flag, [argv])65 66Returns a boolean for whether the flag exists.67 68#### flag69 70Type: `string`71 72CLI flag to look for. The `--` prefix is optional.73 74#### argv75 76Type: `string[]`<br>77Default: `process.argv`78 79CLI arguments.80 81 82## Security83 84To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.85 86 87## License88 89MIT © [Sindre Sorhus](https://sindresorhus.com)90 
basant307/AI_Governance_Project · CoolFace