README
UTerminal
Open source, front end terminal with following features:
- Easy to integrate in Vanilla HTML/JS projects as well as typescript
- Supports command/Input suggestions
- Autosaves all commands to for quick reload with up and down arrow
- Set the UI with CSS library
Install using npm
npm install uterminal
How to use
HTML
<div style="width: 200px; height: 500px;" class="uterminal" id="terminal-id"></div>
Javascript
const terminal = new UTerminal("terminal-id", "signature");
terminal.init();
terminal.newCommandLine();
terminal.onNewCommand(command => {
// handle command here
console.log(command);
terminal.write("Response");
terminal.newCommandLine();
});
//Suggest complete command when user types it partially.
// User can type TAB to accept the input
terminal.giveCommandSuggestion(userInput => {
//Example of suggestion for Hello World as a valid user command
if (userInput === "He") {
return "llo world!"
}
return "";
});