1.0.3 • Published 5 years ago

@xploration/houston v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Houston

Your personal command center!

Houston is a new way to build command-line applications without having to use ugly method chaining.

Usage

Creating a command is extremely simple. Here's a simple echo command:

export class CommandEcho extends CommandBase implements ICommand {
  public function getName(): string {
    return "echo";
  }

  public function getAliases(): string[] {
    return ["e"];
  }

  public function getUsage(): string {
    return "echo <your_string>";
  }

  public function execute(args: string[]): void {
    console.log(args[0])
  }
}

You can then get started by creating a Houston instance and passing in any string array for testing, and process.argv.slice(2) for getting real command line input. Then pass in an array of your commands. I'm working on instantiatiing commands via a directory and naming scheme as well.

new Houston(process.argv.slice(2), [new CommandEcho(), new CommandAdd()]);
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago