{"_id":"has-flag","_rev":"4-8bd6caf6d68593c6a360dac45e157871","name":"has-flag","description":"Check if argv has a specific flag","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"has-flag","version":"1.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":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},{"name":"Joshua Appelman","email":"jappelman@xebia.com","url":"jbnicolai.com"},{"name":"JD Ballard","email":"i.am.qix@gmail.com","url":"github.com/qix-"}],"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["has","check","detect","contains","find","flag","cli","command-line","argv","process","arg","args","argument","arguments","getopt","minimist","optimist"],"devDependencies":{"ava":"0.0.4"},"gitHead":"621de2782d538f28f99f0bb85b158799cb3ae5cf","bugs":{"url":"https://github.com/sindresorhus/has-flag/issues"},"homepage":"https://github.com/sindresorhus/has-flag#readme","_id":"has-flag@1.0.0","_shasum":"9d9e793165ce017a00f00418c43f942a7b1d11fa","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9d9e793165ce017a00f00418c43f942a7b1d11fa","tarball":"https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz"},"directories":{}},"2.0.0":{"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":"https://registry.npmjs.org/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 [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)\n\n> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag\n\nCorrectly stops looking after an `--` argument terminator.\n\n\n## Install\n\n```\n$ npm install --save has-flag\n```\n\n\n## Usage\n\n```js\n// foo.js\nconst hasFlag = require('has-flag');\n\nhasFlag('unicorn');\n//=> true\n\nhasFlag('--unicorn');\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\n## API\n\n### hasFlag(flag, [argv])\n\nReturns a boolean whether the flag exists.\n\n#### flag\n\nType: `string`\n\nCLI flag to look for. The `--` prefix is optional.\n\n#### argv\n\nType: `array`<br>\nDefault: `process.argv`\n\nCLI arguments.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"jbnicolai","email":"jappelman@xebia.com"}],"time":{"modified":"2016-12-20T13:38:31.005Z","created":"2015-07-07T22:43:54.339Z","1.0.0":"2015-07-07T22:43:54.339Z","2.0.0":"2016-04-11T15:47:58.270Z"},"homepage":"https://github.com/sindresorhus/has-flag#readme","keywords":["has","check","detect","contains","find","flag","cli","command-line","argv","process","arg","args","argument","arguments","getopt","minimist","optimist"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/has-flag.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/has-flag/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"michalskuza":true},"_attachments":{},"_etag":"W/\"58593457-12a5\"","_lastModified":"Tue, 20 Dec 2016 13:38:31 GMT","_cached":true}