Options
All
  • Public
  • Public/Protected
  • All
Menu

CLI Workspace utilities

Index

Functions

commandsRoot

  • commandsRoot(): string

getPackageJson

  • getPackageJson(dir: string): any
  • Read/require package.json in a given directory

    Parameters

    • dir: string

      package directory

    Returns any

listRequirable

  • listRequirable(dir: string): string[]
  • List requireable module files in a given directory

    Parameters

    • dir: string

      directory to list

    Returns string[]

resolveConfig

  • Resolves CLI configuration object for the main parser/program. Note that by exposing this function, a caller might obtain different props If called with different options than the main program.

    Parameters

    • Optional options: ICLIOptions

      options propagated by parser or program implementation

    Returns ICLIOptions

resolveDir

  • resolveDir(from: string, name: string): string
  • resolve a directory upwards in the project workspace

    Parameters

    • from: string

      starting directory or file path

    • name: string

      directory name to resolve

    Returns string

resolveFile

  • resolveFile(from: string, name: string): string
  • resolve a file upwards in the project workspace

    Parameters

    • from: string

      starting directory or file path

    • name: string

      file name to resolve

    Returns string

resolveRootDir

  • resolveRootDir(from?: string): string
  • Resolve the project root directory

    Parameters

    • Optional from: string

      a directory or file path from which base scan occurs

    Returns string