{"name":"has-flag","version":"2.0.0","description":"Check if argv has a specific flag","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/has-flag.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"jbnicolai","email":"jappelman@xebia.com"}],"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["has","check","detect","contains","find","flag","cli","command-line","argv","process","arg","args","argument","arguments","getopt","minimist","optimist"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"601137409f2617c75838d8f3febed5c6e6e8ee2c","bugs":{"url":"https://github.com/sindresorhus/has-flag/issues"},"homepage":"https://github.com/sindresorhus/has-flag#readme","_id":"has-flag@2.0.0","_shasum":"e8207af1cc7b30d446cc70b734b5e8be18f88d51","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e8207af1cc7b30d446cc70b734b5e8be18f88d51","tarball":"http://registry-npm.ywwl.com/has-flag/download/has-flag-2.0.0.tgz","integrity":"sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAVqTFFTaeMGmOLp7C8GcVliAujwOiJBlkgnH1vJ67PAiAzfhhRC3Qfcl2Xcy2ecWV5xyaxQu70coaS5895eDJYzA=="}],"size":1850,"noattachment":false,"key":"/has-flag/-/has-flag-2.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/has-flag-2.0.0.tgz_1460389675597_0.3113734829239547"},"directories":{},"readme":"# has-flag\n\n> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag\n\n## Install\n\n```\n$ npm install has-flag\n```\n\n## Usage\n\n```js\n// foo.js\nimport hasFlag from 'has-flag';\n\nhasFlag('unicorn');\n//=> true\n\nhasFlag('--unicorn');\n//=> true\n\nhasFlag('f');\n//=> true\n\nhasFlag('-f');\n//=> true\n\nhasFlag('foo=bar');\n//=> true\n\nhasFlag('foo');\n//=> false\n\nhasFlag('rainbow');\n//=> false\n```\n\n```\n$ node foo.js -f --unicorn --foo=bar -- --rainbow\n```\n\n## API\n\n### hasFlag(flag, argv?)\n\nReturns a boolean for whether the flag exists.\n\nIt correctly stops looking after an `--` argument terminator.\n\n#### flag\n\nType: `string`\n\nCLI flag to look for. The `--` prefix is optional.\n\n#### argv\n\nType: `string[]`\\\nDefault: `process.argv`\n\nCLI arguments.\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<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>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","publish_time":1460389678270,"_cnpm_publish_time":1460389678270,"dist-tags":{"latest":"5.0.1"}}