1 # has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
3 > Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
5 Correctly stops looking after an `--` argument terminator.
11 $ npm install --save has-flag
19 var hasFlag = require('has-flag');
38 $ node foo.js --unicorn --foo=bar -- --rainbow
44 ### hasFlag(flag, [argv])
46 Returns a boolean whether the flag exists.
52 CLI flag to look for. The `--` prefix is optional.
57 Default: `process.argv`
64 MIT © [Sindre Sorhus](http://sindresorhus.com)