{"name":"command-line-usage","author":{"name":"Lloyd Brookes","email":"opensource@75lb.com"},"version":"7.0.4","description":"Generates command-line usage information","repository":{"type":"git","url":"git+https://github.com/75lb/command-line-usage.git"},"license":"MIT","type":"module","exports":{"import":"./index.js","require":"./dist/index.cjs"},"keywords":["terminal","command line","usage","generator"],"engines":{"node":">=12.20.0"},"scripts":{"docs":"jsdoc2md --no-gfm index.js lib/**/*.js > doc/api.md; echo","test":"npm run dist && npm run test:ci","test:ci":"test-runner test/*.js test/*.cjs","examples":"for FILE in example/*.js; do printf \"\n\n======== $FILE ========\n\n\"; node $FILE; done","dist":"rollup -c"},"dependencies":{"array-back":"^6.2.2","chalk-template":"^0.4.0","table-layout":"^4.1.1","typical":"^7.3.0"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.3","jsdoc-to-markdown":"^9.1.3","rollup":"^4.59.0","test-runner":"^0.10.1"},"standard":{"ignore":["example","dist"]},"gitHead":"f3dbb83dd7883b72a8bf84df9234bc8bb784d926","_id":"command-line-usage@7.0.4","bugs":{"url":"https://github.com/75lb/command-line-usage/issues"},"homepage":"https://github.com/75lb/command-line-usage#readme","_nodeVersion":"25.0.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-85UdvzTNx/+s5CkSgBm/0hzP80RFHAa7PsfeADE5ezZF3uHz3/Tqj9gIKGT9PTtpycc3Ua64T0oVulGfKxzfqg==","shasum":"759449bac39c5410e23513f1f78551b669df1514","tarball":"http://registry-npm.ywwl.com/command-line-usage/download/command-line-usage-7.0.4.tgz","fileCount":9,"unpackedSize":108313,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICBT8u4DN8dyQgRWomlbhNGkel/lFiSr4e6ov1RfPVnSAiAm+JILJr+pZr9GJ6IALlCh4x2P+W86LRBpeUEQStYeIg=="}],"size":27458,"noattachment":false,"key":"/command-line-usage/-/command-line-usage-7.0.4.tgz"},"_npmUser":{"name":"75lb","email":"opensource@75lb.com"},"directories":{},"maintainers":[{"name":"75lb","email":"opensource@75lb.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/command-line-usage_7.0.4_1772463742261_0.6483035656867484"},"_hasShrinkwrap":false,"readme":"[![view on npm](https://badgen.net/npm/v/command-line-usage)](https://www.npmjs.org/package/command-line-usage)\n[![npm module downloads](https://badgen.net/npm/dt/command-line-usage)](https://www.npmjs.org/package/command-line-usage)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/command-line-usage)](https://github.com/75lb/command-line-usage/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/command-line-usage)](https://github.com/75lb/command-line-usage/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/command-line-usage/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/command-line-usage/actions/workflows/node.js.yml)\n\n# command-line-usage\n\n***Upgraders, please check the [release notes](https://github.com/75lb/command-line-usage/releases).***\n\nA simple, data-driven module for creating a usage guide.\n\n## Synopsis\n\nA usage guide is created by first defining an arbitrary number of sections, e.g. a description section, synopsis, option list, examples, footer etc. Each section has an optional header, some content and must be of type [`content`](https://github.com/75lb/command-line-usage/blob/master/doc/api.md#module_command-line-usage--commandLineUsage..content) or [`optionList`](https://github.com/75lb/command-line-usage/blob/master/doc/api.md#module_command-line-usage--commandLineUsage..optionList). This section data is passed to [`commandLineUsage()`](https://github.com/75lb/command-line-usage/blob/master/doc/api.md#exp_module_command-line-usage--commandLineUsage) which returns a usage guide.\n\nInline ansi formatting can be used anywhere within section content using [chalk template literal syntax](https://github.com/chalk/chalk/tree/v2.4.2#tagged-template-literal).\n\nFor example, this script:\n```js\nimport commandLineUsage from 'command-line-usage'\n\nconst sections = [\n  {\n    header: 'A typical app',\n    content: 'Generates something {italic very} important.'\n  },\n  {\n    header: 'Options',\n    optionList: [\n      {\n        name: 'input',\n        typeLabel: '{underline file}',\n        description: 'The input to process.'\n      },\n      {\n        name: 'help',\n        description: 'Print this usage guide.'\n      }\n    ]\n  }\n]\nconst usage = commandLineUsage(sections)\nconsole.log(usage)\n```\n\nOutputs this guide:\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/synopsis.png\" width=\"90%\">\n\n## Some examples\n\n### Typical\n\nA fairly typical usage guide with three sections - description, option list and footer. [Code](https://github.com/75lb/command-line-usage/wiki/How-to-create-a-typical-usage-guide).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/simple.png\" width=\"90%\">\n\n### Option List groups\n\nDemonstrates breaking the option list up into groups. [Code](https://github.com/75lb/command-line-usage/wiki/How-to-break-the-option-list-up-into-groups).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/groups.png\" width=\"90%\">\n\n### Banners\n\nA banner is created by adding the `raw: true` property to your `content`. This flag disables any formatting on the content, displaying it raw as supplied.\n\n#### Header\n\nDemonstrates a banner at the top. This example also adds a `synopsis` section. [Code](https://github.com/75lb/command-line-usage/wiki/How-to-add-a-banner-to-your-usage-guide#code).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/header.png\" width=\"90%\">\n\n#### Footer\n\nDemonstrates a footer banner. [Code](https://github.com/75lb/command-line-usage/wiki/How-to-add-a-banner-to-your-usage-guide#code-1).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/footer.png\" width=\"90%\">\n\n### Examples section (table layout)\n\nAn examples section is added. To achieve this table layout, supply the `content` as an array of objects. The property names of each object are not important, so long as they are consistent throughout the array. [Code](https://github.com/75lb/command-line-usage/wiki/How-to-add-an-examples-section-to-your-usage-guide).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/example-columns.png\" width=\"90%\">\n\n### Advanced optionList layout\n\nThe `optionList` layout is fully configurable by setting the `tableOptions` property with an options object suitable for passing into [table-layout](https://github.com/75lb/table-layout#table-). This example overrides the default column widths and adds flame padding. [Code](https://github.com/75lb/command-line-usage/wiki/How-to-use-advanced-optionList-table-formatting).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/option-list-options.png\" width=\"90%\">\n\n### Command list\n\nUseful if your app is command-driven, like git or npm. [Code](https://github.com/75lb/command-line-usage/wiki/How-to-add-a-command-list-to-your-usage-guide).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/command-list.png\" width=\"90%\">\n\n### Description section (table layout)\n\nDemonstrates supplying specific [table layout](https://github.com/75lb/table-layout) options to achieve more advanced layout. In this case the second column (containing the hammer and sickle) has a fixed `width` of 40 and `noWrap` enabled (as the input is already formatted as desired). [Code](https://github.com/75lb/command-line-usage/wiki/How-to-add-a-description-section-to-your-usage-guide).\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/description-columns.png\" width=\"90%\">\n\n### Real-life\n\nThe [polymer-cli](https://github.com/Polymer/tools/tree/master/packages/cli) usage guide is a good real-life example.\n\n<img src=\"https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/polymer.png\" width=\"90%\">\n\n## Documentation\n\n* [API Reference](https://github.com/75lb/command-line-usage/blob/master/doc/api.md)\n* [The full list of examples](https://github.com/75lb/command-line-usage/wiki)\n\n* * *\n\n&copy; 2015-26 Lloyd Brookes \\<opensource@75lb.com\\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).\n","publish_time":1772463742429,"_cnpm_publish_time":1772463742429,"dist-tags":{"latest":"7.0.4"}}