Decaf-ts' CLI module
Example
run module command - $ npx decaf <module name> <module command> ...<module command options>
get module help - $ npx decaf help <module name>;
list imported modules - $ npx decaf list;
get cli help - $ npx decaf help;
Members
# static constant CLI_FILE_NAME
The standard filename for CLI module files where each library must export a single CliModule function
The filename that identifies Decaf CLI modules
# static constant VERSION
A constant that holds the version string of the package, which is replaced during build
Stores the current package version
Methods
# static demo() → {Command}
A minimal implementation showing how to extend the Decaf CLI with custom commands. This module demonstrates the pattern for creating CLI modules that can be discovered and loaded by the Decaf CLI.
Demo CLI module for Decaf libraries
The Command object to be added to the main Decaf CLI
Command
Example
// Run the demo command with an argument
npx decaf demo command "something something"
// Output:
// executed demo command with type variable: something something
Type Definitions
# CliModule() → {Command|Promise.<Command>}
Defines the signature for CLI module functions that each Decaf module must export under the CLI_FILE_NAME file The function should return a Command object or a Promise that resolves to a Command object
Function type for Decaf CLI modules
A Command object or Promise that resolves to a Command object
Command
|
Promise.<Command>