Hierarchy (view full)

Constructors

Properties

args: string[] = []

Extra arguments passed from the command line.

commandTree: CommandTree<default> = {}

All registered commands.

connect: ((url, timeout?) => Promise<void>) = ...

Type declaration

    • (url, timeout?): Promise<void>
    • Parameters

      • url: string
      • timeout: number = 5

      Returns Promise<void>

currentCommand: string = ''

Currently executing command.

cwd: string = ...

Current working directory at launch of process.

env: Record<string, string> = ...

Process environment at lauch of process.

info: string

Description of this command tree.

name: string

Name of this command tree.

timestamp: string = ...

Start of command execution.

Methods

  • Define a command and return this.

    Type Parameters

    Parameters

    • parameters: {
          args: string;
          info: string;
          name: string;
      }
      • args: string
      • info: string
      • name: string
    • step: X

    Returns this

  • Attach a command subtree and return this.

    Parameters

    • name: string
    • info: string
    • subtree: default

    Returns this

  • Define a command and return it.

    Type Parameters

    Parameters

    • parameters: {
          args: string;
          info: string;
          name: string;
      }
      • args: string
      • info: string
      • name: string
    • step: X

    Returns X

  • Attach a command subtree and return it.

    Type Parameters

    • C extends default

    Parameters

    • name: string
    • info: string
    • subtree: C

    Returns C

  • If this command tree is the default export of the process entrypoint, run the commands as specified by the process command line.

    Parameters

    • url: string
    • argv: string[] = ...

    Returns this

    Example

    export default myCommands.main(import.meta.url)
    
  • End the process.

    Parameters

    • code: number = 0

    Returns void

  • Filter commands by each word from the list of arguments then pass the rest as arguments to the found command.

    Parameters

    • args: string[]

    Returns [default | Command<default>, ...string[]]

  • Parameters

    • __namedParameters: default

    Returns Promise<void>

  • Parameters

    • arg0: default

    Returns Promise<void>

  • Parameters

    • arg0: this

    Returns Promise<void>

  • Run a command from this command tree.

    Type Parameters

    • T

    Parameters

    • argv: string[]
    • context: any = ...

    Returns Promise<T>

  • Start an interactive REPL with this deployment as global context.

    Returns Promise<void>

    Throws

    if the node:repl and node:vm native modules are unavailable.

Generated using TypeDoc