Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
  2. > Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
  3. Correctly stops looking after an `--` argument terminator.
  4. ---
  5. <div align="center">
  6. <b>
  7. <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>
  8. </b>
  9. <br>
  10. <sub>
  11. Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
  12. </sub>
  13. </div>
  14. ---
  15. ## Install
  16. ```
  17. $ npm install has-flag
  18. ```
  19. ## Usage
  20. ```js
  21. // foo.js
  22. const hasFlag = require('has-flag');
  23. hasFlag('unicorn');
  24. //=> true
  25. hasFlag('--unicorn');
  26. //=> true
  27. hasFlag('f');
  28. //=> true
  29. hasFlag('-f');
  30. //=> true
  31. hasFlag('foo=bar');
  32. //=> true
  33. hasFlag('foo');
  34. //=> false
  35. hasFlag('rainbow');
  36. //=> false
  37. ```
  38. ```
  39. $ node foo.js -f --unicorn --foo=bar -- --rainbow
  40. ```
  41. ## API
  42. ### hasFlag(flag, [argv])
  43. Returns a boolean for whether the flag exists.
  44. #### flag
  45. Type: `string`
  46. CLI flag to look for. The `--` prefix is optional.
  47. #### argv
  48. Type: `string[]`<br>
  49. Default: `process.argv`
  50. CLI arguments.
  51. ## Security
  52. To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
  53. ## License
  54. MIT © [Sindre Sorhus](https://sindresorhus.com)