input-terminal
    Preparing search index...

    Interface TerminalConfig

    Allows you to turn any HTMLInputElement into a terminal interface. Define custom commands that can be executed by users, track command history, autocomplete commands, and more.

    import { Terminal, Command } from "input-terminal";
    import { DOMOutputAdapter } from "input-terminal/dom";
    const input = document.getElementById("terminal") as HTMLInputElement;
    const output = document.getElementById("output") as HTMLElement;
    const terminal = new Terminal({
    input,
    output: new DOMOutputAdapter(output),
    options: { prompt: ">> " },
    });
    terminal.bin.add(new Command("echo", (args, options, terminal) => {
    terminal.stdout(args.join(" "));
    return {};
    }));
    terminal.init();
    interface TerminalConfig {
        input: HTMLInputElement;
        output?: OutputAdapter;
        options?: Partial<TermOptions>;
        history?: ExitObject[];
        commands?: Command[];
    }
    Index
    input: HTMLInputElement
    output?: OutputAdapter
    options?: Partial<TermOptions>
    history?: ExitObject[]
    commands?: Command[]