{"name":"sywac","version":"2.0.0-rc3","description":"So you want a CLI...","main":"index.js","scripts":{"pretest":"standard","test":"tap","coverage":"nyc report --reporter=text-lcov | coveralls"},"engines":{"node":">=8"},"repository":{"type":"git","url":"git+https://github.com/sywac/sywac.git"},"keywords":["cli","parser","command","args","argv"],"author":{"name":"nexdrew"},"license":"MIT","bugs":{"url":"https://github.com/sywac/sywac/issues"},"homepage":"http://sywac.io","devDependencies":{"chalk":"^3.0.0","coveralls":"^3.0.9","del":"^5.1.0","import-fresh":"^3.2.1","standard":"^14.3.2","tap":"^14.10.6"},"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","readmeFilename":"README.md","gitHead":"74ade35bb391b5ce3d2de8bd771ff3387649ffec","_id":"sywac@2.0.0-rc3","_nodeVersion":"12.16.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-t/Nt87FY2347o1Y0pDTEYqsu2VRdNiVh3vXh9+cr9A5a6o1D0eM0D2y0+6UQjmylb7KT4l0NojSuvG1OhNEiOw==","shasum":"dc2732977fbd837f3c557e91bbb8d05c183abdd0","tarball":"http://registry-npm.ywwl.com/sywac/download/sywac-2.0.0-rc3.tgz","fileCount":22,"unpackedSize":104945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejgGzCRA9TVsSAnZWagAAlvYP/jxVKrJY5+oV7usGpTHa\nbiN8xiwb/Vw2ZkM5/+Eh8eKiKbYcnZQ+VNliMtIl1jqFy4zrt4Vzq0WTRpkz\ncD8OVP1IRTFwwLTNFCCFMfI8jNlz4HBjDr4FZ6V8kJGgOsJdZJT10ljB+fbC\nm8nrGgiAaDAScN4SI00/VNYaOa6trAMEoOIf744BBf+L1026E0snOlrkUDvL\na7Oh5+nixopQvVVWZj5I5XJ0lzRiGF5mvuaI60sZ1Xah0IeWsDDgsBFkGH3T\nsTeU13p/VrRPVuW/jtG/QZdlINjEYnfvxVIyQcWd7XqU3pIIYuVyPVF1Ejox\nf93Z3dRrTVYPqtzTLSbQBE2P69tD+A4ZHBhxgkKcaTBGlkIHeWt0MkkHAnRn\nDDFSe3uyN53QFsqM6wTIBiGav5mKEWpqTWA7EW4HHvQ3wjFEVLBpk9cTbAGS\nx5kDMNLUxpGzpOKhb5U1VT5CAxnT1ydoqKAtGTS5kRv982RTrVhRP12IF4WU\nRbZy1DlSOZeTKmSAPir70IpF9OlYT6IKNMaN/CQhj1bMp6ByaSROvKlvknfh\n93bUoQ5uNhs0Lyox1WqMVEuk4H2Ty9Sj3gRo5Nk+mBZ5tmpkS1aUQ/Q38YKf\n503FTI6VCwfNew6fy+9cyMvKhowzEiRewazY8ZEBEsiEi+h6fb2avQCvjELt\ncdMS\r\n=4DmE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEmUeyvbTP01qGGhfiSPLfKF43OHtGKvdDz5RpcQ8ukKAiEAsjRof52boAzKHS7I8Unf37Om1kmDu/NbqLuY+R53Njg="}],"size":27508,"noattachment":false,"key":"/sywac/-/sywac-2.0.0-rc3.tgz"},"maintainers":[{"name":"nexdrew","email":"andrewbgoode@gmail.com"}],"_npmUser":{"name":"nexdrew","email":"andrewbgoode@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sywac_2.0.0-rc3_1586364851153_0.47726278367756536"},"_hasShrinkwrap":false,"publish_time":1586364851335,"_cnpm_publish_time":1586364851335,"dist-tags":{"latest":"1.3.0","rc":"2.0.0-rc4"}}