To skip the tutorial, Click Here
JLI is an web framework for creating terminal interfaces, similar to jQuery Terminal
I'll create a simple JavaScript Interpreter, and show you how to do it along the way.
First, we need to import JLI into our HTML Document.
<script src='https://cdn.jsdelivr.net/gh/skzidev/JLI/index.js'></script>
With that, JLI has been brought into the environment, and it should look like this:
Now it's time to implement our logic using the tools JLI Provides
window.jli.setCommandCallback((command) => {
	let result = eval('(' + command + ')');
	window.jli.showMessage(result);
});
Now, it should look like this:
And with that, You're finished. You've created a simple JavaScript Evaluator using JLI.
window.jli.showMessage(str : Message, str : Color)
Show a terminal message to the user
Arguments
Message : str
The message to show
Color : str
A CSS Color value representing the color of the text, defaults to white
window.jli.getInput()
Gets input from the user via the terminal.
Returns
Promise : Resolves with string of text provided
window.jli.setCommandCallback(method : Callback)
Sets the callback to be run when a user submits the input
Arguments
Callback : Method
The callback to run on submit
window.jli.removePreviousMessage()
Removes the previous message shown in the terminal
window.jli.clearScreen()
Clears the screen of all previous commands
window.jli.setCaret(string : Character)
Sets the text character to act as the text caret.
Arguments
Character : Method
The character to set the text caret to. Defaults to "_".
window.jli.showCursor(boolean : show)
Shows or hides the cursor.
Arguments
Show : Boolean
Indicates if the cursor should be shown or hidden.
true indicates the cursor should be shown.
false indicates the cursor should be hidden.
Defaults to false