import { DirectoryCore } from "https://deno.land/x/johnny_decimal@1.0.3/models/directory_core.ts";
Examples
class Directory extends DirectoryCore {
constructor($JD_HOME){ this.$JD_HOME = $JD_HOME; }
}
const directory = new DirectoryCore()
directory.registerCommand({
name: "log-home",
fn: () => {
console.log(this.$JD_HOME)
}
});
directory.runCommand("log-home");
class Directory extends DirectoryCore { constructor($JD_HOME){ this.$JD_HOME = $JD_HOME; } } const directory = new DirectoryCore() directory.registerCommand({ name: "log-home", fn: () => { console.log(this.$JD_HOME) } }); directory.runCommand("log-home");
Methods
private
retrieveCommand(commandName: string)hasCommand(name: string): boolean
registerAlias(commandName: string, aliasNames?: string[]): void
registerCommand(command: Command): void
runCommand(commandName: string, args: string[])