New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

command-line-docs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

command-line-docs

Generate markdown documentation based on your [command-line-application](https://github.com/hipstersmoothie/command-line-application) command definitions

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

command-line-docs

Generate markdown documentation based on your command-line-application command definitions

Installation

npm i -D command-line-docs
# or
yarn add -D command-line-docs

Usage

This package support both the Command and MultiCommand from command-line-application.

import { Command } from 'command-line-application';
import docs from 'command-line-docs';

const echo: Command = {
  name: 'echo',
  description: 'Print a string to the terminal',
  options: [
    {
      name: 'value',
      type: String,
      defaultOption: true,
      description: 'The value to print',
    },
  ],
};

console.log(docs(echo));

This will output:

# `echo`

Print a string to the terminal

## Options

| Flag        | Type   | Description        |
| ----------- | ------ | ------------------ |
| \`--value\` | String | The value to print |

Options

Depth

Control the header depth.

// Now the docs will start with an h2 instead of an h1
docs(echo, { depth: 1 });

Including global options with each sub-command

You might want to include the global options in each sub-command's options table. To do this use the includeGlobalOptionsForSubCommands option.

docs(echo, { includeGlobalOptionsForSubCommands: true });

FAQs

Package last updated on 17 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts