New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

commanderdoc

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commanderdoc

  • 0.1.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

commanderdoc - v0.1.11Globals

commanderdoc - v0.1.11

Usage

commanderdoc [options] [command]

Commands

markdown <sourcefile>

Usage

commanderdoc markdown [options] <sourcefile>

Options

  • -e --exported <commanderObject> Name of the exported commander object to inspect (default: commander)
  • -o --out-file <outfile> File to store markdown output (defaults to stdout)
  • -n --cli-name <name> Name of the executable

json <sourcefile>

Extract inspected commander as JSON

Usage

commanderdoc json [options] <sourcefile>

Options

  • -e --exported <commanderObject> Name of the exported commander object to inspect (default: commander)
  • -o --out-file <outfile> File to store markdown output (defaults to stdout)

commanderdoc - v0.1.11Globals

commanderdoc - v0.1.11

Index

Type aliases

Functions

Type aliases

CommandType

Ƭ CommandType: object

Defined in index.ts:42

Type declaration:
  • args? : object[]

  • commands? : CommandType[]

  • description? : undefined | string

  • name: string

  • options? : OptionType[]


OptionType

Ƭ OptionType: ReturnType‹typeof getOption›

Defined in index.ts:41

Functions

commandToMd

commandToMd(command: CommandType, startLevel: number, parents: string[]): string

Defined in index.ts:104

Convert an inspected command to a markdown string

Parameters:

NameTypeDefaultDescription
commandCommandType-inspected command to inspect (result of getCommand(command))
startLevelnumber1header level to start with
parentsstring[][]list of parent commands and cli name to document usage

Returns: string


commanderToMd

commanderToMd(commander: object, cliName: string, startLevel: number): string

Defined in index.ts:173

Document a top-level cli - recommended use case

Parameters:

NameTypeDefaultDescription
commanderobject-Top level commander object (usually from export commander or module.exports.commander = commander)
cliNamestring-Name of the executable (for usage documentation)
startLevelnumber1Level to start the markdown headers (e.g. use 2 or greater to fit it into sub-documentation)

Returns: string


getCommand

getCommand(command: object): CommandType

Defined in index.ts:60

Generate a map of properties of a command object

Parameters:

NameTypeDescription
commandobjectCommander command object to inspect

Returns: CommandType


getCommands

getCommands(commands: object[]): CommandType[]

Defined in index.ts:53

Recursively inspect a list of commands

Parameters:

NameTypeDescription
commandsobject[]List of commands to inspect (usually from command.commands)

Returns: CommandType[]


getOption

getOption(option: object): object

Defined in index.ts:13

Get filtered list of attributes for a single options

Parameters:

NameTypeDescription
optionobjectOption for a commands

Returns: object

  • args: any

  • defaultValue: any

  • description: any

  • flags: any

  • long: any

  • mandatory: any

  • negate: any

  • optional: any

  • required: any

  • short: any

  • variadic: any


getOptions

getOptions(options: any[]): object[]

Defined in index.ts:7

Get filtered map of attributes for a list of options

Parameters:

NameTypeDescription
optionsany[]Options for a command

Returns: object[]


optionToMd

optionToMd(option: OptionType): string

Defined in index.ts:87

Generate markdown for a single commander option

Parameters:

NameTypeDescription
optionOptionTypeOption to generate markdown for

Returns: string


padLevel

padLevel(level: number): string

Defined in index.ts:81

Generate a markdown header prefix at the indicated level

internal

Parameters:

NameTypeDescription
levelnumberlevel of the markdown header padding

Returns: string

FAQs

Package last updated on 07 Aug 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc