{"bugs":{"url":"https://github.com/sywac/sywac/issues"},"dist":{"shasum":"fe45937d8dff86eb610118e2dfd2ce4d42a0ce89","tarball":"https://registry.npmjs.org/sywac/-/sywac-2.0.0-rc2.tgz","fileCount":22,"integrity":"sha512-6RmKEjee/sCGRU+MB0kcoVlet+snEpeaQfZKirN/rNZg9+CyTOAMMsysBsJqIMUWhjDUuPLhFXapmq2bTdNazQ==","signatures":[{"sig":"MEUCIFYFfgqbyGvKVWqHvr5ciJMZF5eO/GirDq5Sw19tuqTqAiEAqqQoGy4/qxJUripMSqxdPMzK/Bh7POjxtDBZF7IeAuY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejfP/CRA9TVsSAnZWagAAcB0P/jsDlN1zeUNjdkJ4B6d9\n8W//avxd0C1IkUneQi6JVj3HnOkq1BHy0LXxtGgsMUoblUUDQm3Gk2+BTLIh\nB6A/a7LN9f+Gx1MN7SIlenkHydoeDBFCShYWgbwOc5n/y8fRgyS1Qs+wj8BV\nA2g4OUys/7yzvxpTKOdF78BNDuIhWG/jJbkmakau+yB25nvEyYZr/efuuEx6\nwU5ujsWoswVxgYxx4CeC21qvJWWR1TcGEzVdxD79r/UBp663539WLeowDMnl\nivDfNjv2U9EqnXLiH8jxDVvjSiId32MEnZ/7aLx8KVa3MtmGS9UHduHkpHZ7\nq+Reizns0iasn4UkW94IDULjMVxOzlc9bbGVz6BQl8rAmFxYdyLWNqFIgfbL\nP3Ua19ZYdCD1kHEhoR18rryfLUgCMSOSixrge2qAF1cVe6/ovadU41zhMCK0\ny1uhVUUKgzb9ovO0IOk67BGheCCJ9xTwEUxu3tLxqYeER5sFyS0Fybmtg6Ma\nA1dR3y5XjZnEExILNAKJCA21b9ecW5THLu+Q2D2GlqaSBIyc31uO0flAAGt8\n+vtOKn5ILTEQoX9WStAtQQV3Y/jPALnnEV6UnLoqnS38991nsk4V1Tc/Y0wj\nrxRqchmQTbpHSTfD18oXCP+ny2mPWKNAVBCseUfNrIvG+2OsNtpNUtP03OhG\nOgg6\r\n=fSvF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","name":"sywac","author":{"name":"nexdrew"},"readme":"# ![sywac](logo.png)\n\n> So you want a CLI...\n\n[![Build Status](https://travis-ci.org/sywac/sywac.svg?branch=master)](https://travis-ci.org/sywac/sywac)\n[![Coverage Status](https://coveralls.io/repos/github/sywac/sywac/badge.svg?branch=master)](https://coveralls.io/github/sywac/sywac?branch=master)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Greenkeeper badge](https://badges.greenkeeper.io/sywac/sywac.svg)](https://greenkeeper.io/)\n\nA better CLI framework, made for the ES2015 era.\n\nVisit http://sywac.io for detailed documentation. **NOTE!** The docs site is still under construction.\n\n## Feature Highlights\n\n- Single package install\n- Asynchronous parsing, validation, and command execution\n- Type-based argument parsing\n- Plug in your own types or override/extend the built-in ones\n- Support for simple CLIs or complex nested command trees\n- First-class support for positional arguments, with or without commands\n- Flexible auto-generated help content\n- Support for ANSI styles/colors (we recommend [chalk](https://github.com/chalk/chalk))\n- Define styles/colors inline or decorate content with style hooks\n- Coherent API\n- Parse strings as easily as `process.argv`\n- Supports concurrent parsing, safe for chatbots or other server-side apps\n\n## Quick Start Guide\n\nFirst install sywac from npm:\n\n```console\n$ npm install --save sywac\n```\n\nThen create a `cli.js` file with code similar to this:\n\n```js\n#!/usr/bin/env node\n\nconst sywac = require('sywac')\n\nasync function main () {\n  const argv = await sywac\n    .positional('<string>', { paramsDesc: 'A required string argument' })\n    .boolean('-b, --bool', { desc: 'A boolean option' })\n    .number('-n, --num <number>', { desc: 'A number option' })\n    .help('-h, --help')\n    .version('-v, --version')\n    .showHelpByDefault()\n    .outputSettings({ maxWidth: 75 })\n    .parseAndExit()\n  console.log(JSON.stringify(argv, null, 2))\n}\n\nmain()\n```\n\nMake the `cli.js` file executable:\n\n```console\n$ chmod +x cli.js\n```\n\nAnd set up `cli.js` as the `\"bin\"` field in `package.json`:\n\n```json\n{\n  \"name\": \"example\",\n  \"version\": \"0.1.0\",\n  \"bin\": \"cli.js\"\n}\n```\n\nThen test it out. Without any arguments, it will print the help text.\n\n```console\n$ ./cli.js\nUsage: cli <string> [options]\n\nArguments:\n  <string>  A required string argument                  [required] [string]\n\nOptions:\n  -b, --bool          A boolean option                            [boolean]\n  -n, --num <number>  A number option                              [number]\n  -h, --help          Show help                  [commands: help] [boolean]\n  -v, --version       Show version number     [commands: version] [boolean]\n```\n\nLet's try passing some arguments:\n\n```console\n$ ./cli.js hello -b -n 42\n{\n  \"_\": [],\n  \"string\": \"hello\",\n  \"b\": true,\n  \"bool\": true,\n  \"n\": 42,\n  \"num\": 42,\n  \"h\": false,\n  \"help\": false,\n  \"v\": false,\n  \"version\": false\n}\n```\n\nWhat happens if we pass flags without a string argument?\n\n```console\n$ ./cli.js --bool\nUsage: cli <string> [options]\n\nArguments:\n  <string>  A required string argument                  [required] [string]\n\nOptions:\n  -b, --bool          A boolean option                            [boolean]\n  -n, --num <number>  A number option                              [number]\n  -h, --help          Show help                  [commands: help] [boolean]\n  -v, --version       Show version number     [commands: version] [boolean]\n\nMissing required argument: string\n```\n\nValidation failed and sywac printed the help text with an error message. Let's check the exit code of that last run:\n\n```console\n$ echo $?\n1\n```\n\nThis is a good sign that our CLI will play well with others.\n\n## API\n\nFor details on the full API, go to http://sywac.io\n\n## License\n\nMIT\n","engines":{"node":">=8"},"gitHead":"0249cc47ca1e3b286d924fdda8e9c6f4a746afff","license":"MIT","scripts":{"test":"tap","pretest":"standard","coverage":"nyc report --reporter=text-lcov | coveralls"},"_npmUser":{"name":"nexdrew","email":"andrewbgoode@gmail.com"},"homepage":"http://sywac.io","keywords":["cli","parser","command","args","argv"],"repository":{"url":"git+https://github.com/sywac/sywac.git","type":"git"},"_npmVersion":"6.14.4","description":"So you want a CLI...","directories":{},"maintainers":[{"name":"nexdrew","email":"andrewbgoode@gmail.com"}],"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"del":"^5.1.0","tap":"^14.10.6","chalk":"^3.0.0","standard":"^14.3.2","coveralls":"^3.0.9","import-fresh":"^3.2.1"},"_npmOperationalInternal":{"tmp":"tmp/sywac_2.0.0-rc2_1586361342918_0.5388737156919119","host":"s3://npm-registry-packages"},"_id":"sywac@2.0.0-rc2","version":"2.0.0-rc2"}