Options
All
  • Public
  • Public/Protected
  • All
Menu

cli-belt v2.0.0

Index

Functions

  • Formats and prints an error message.

    options:

    • exit: if passed, it will exit the process with that code.
    • logger: if passed, it will use that instead of console.error
    • debug: if true, it will also log the error itself after its message -if logger is passed, it will use logger.debug instead of console.debug

    Parameters

    Returns void

  • flags(help: string, options?: FlagsOptions): { aliases: Record<string, string>; options: Record<string, Flag> }
  • Parses a help string and returns an object with options, aliases, arugments, and descriptions.

    Parameters

    Returns { aliases: Record<string, string>; options: Record<string, Flag> }

    • aliases: Record<string, string>
    • options: Record<string, Flag>
  • It will find and return the contents of the first package.json found, recursing up, starting on dir. It can optionally normalize the data and set the process.title to the package name.

    Parameters

    Returns Promise<Package>

  • safePairs(a: Record<string, any>, b: Record<string, any>, options?: SafePairsOptions): boolean
  • Ensures all properties of a exist in b -and optionally, also vice versa. Returns true if they do.

    Parameters

    Returns boolean

  • splitBy(argv: string[], separator?: string): [string[], string[]]
  • Splits argv into two arrays by the first separator found. If it's not found, the second array returned will be empty.

    Parameters

    • argv: string[]
    • separator: string = '--'

    Returns [string[], string[]]

Generated using TypeDoc