Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Term.js

It's a basic terminal implemented in pure Javascript, it provides a basic REPL and you can customize how the commands are interpreted.

Features

  • Basic shell
  • Custom command interpreter
  • Pure javascript and withour dependencies
  • Command highlighting
  • Command history
  • Quoted arguments support (strings)
  • Suggestion and autocompletion
  • Tab keys and arrow keys movement
  • Output coloring (VT100 emulation or something like that)

Customized

Usage

    <link rel="stylesheet" href="term.css">
    <script src="term.js"></script>

Options

Term.js has only one option, that is the class for read and run the commands:

    var term = new Terminal(document.querySelector(".terminal"), {
        interpreterClass: MyCustomClass // The default is the DummyInterpreter
    });

Example

    window.addEventListener('load', () => {
        var terminal = new Terminal(document.querySelector(".terminal"));
        terminal.writeLine("***************************************");
        terminal.writeLine("* Welcome to Term.js                 *");
        terminal.writeLine("***************************************");
        terminal.start();
    });

I am adding more examples in termjs/examples folder.

Screenshots

Basic Old School

License

Apache 2.0

About

A basic Terminal idea in Javascript (Vanilla)

Topics

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.