Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CommandExecuteContext

Context for an Command.#execute() invocation.

Hierarchy

  • CommandExecuteContext

Index

Properties

args

args: ParsedArgs

The parsed arguments.

cwd

cwd: string

The working directory.

exit

exit: (code?: number) => void

Exists the process.

param

The custom, relative exit code. Default: 0

Type declaration

    • (code?: number): void
    • Parameters

      • Optional code: number

      Returns void

getFullPath

getFullPath: (p: any) => string

Returns the full version of a path, based on the value for 'current working directory'.

param

The input value.

returns

The full path.

Type declaration

    • (p: any): string
    • Parameters

      • p: any

      Returns string

name

name: string

The normalized name.

package

package: PackageJSON

App information.

queue

queue: PQueue

A queue that allows only one operation at once.

root

root: string

The root directory of the command.

values

values: any

A key/value pair storage, that is available while the execution.

verbose

verbose: boolean

Indicates if app runs in verbose mode or node.

Methods

get

  • get<TResult, TDefault>(key: any, defaultValue?: TResult): TResult | TDefault
  • Tries to return a value from the config storage.

    Type parameters

    • TResult

    • TDefault

    Parameters

    • key: any

      The key.

    • Optional defaultValue: TResult

    Returns TResult | TDefault

    The value, if found.

require

  • require<TModule>(id: string): TModule
  • Loads a module from (CLI) app context.

    Type parameters

    • TModule

    Parameters

    • id: string

      The ID of the module.

    Returns TModule

    The module.

Generated using TypeDoc