All Projects â†’ zhw2590582 â†’ Term Web

zhw2590582 / Term Web

Licence: mit
📟 A simple Terminal UI that run on the web

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Term Web

Mylittledom
High-level DOM-like terminal interface library
Stars: ✭ 116 (+50.65%)
Mutual labels:  terminal, browser
Amfora
A fancy terminal browser for the Gemini protocol.
Stars: ✭ 395 (+412.99%)
Mutual labels:  terminal, browser
Terminal Canvas
Manipulate the cursor in your terminal via high-performant, low-level, canvas-like API
Stars: ✭ 125 (+62.34%)
Mutual labels:  terminal, canvas
Capture Frame
Capture video screenshot from a `<video>` tag (at the current time)
Stars: ✭ 109 (+41.56%)
Mutual labels:  browser, canvas
Minipaint
online image editor
Stars: ✭ 1,014 (+1216.88%)
Mutual labels:  browser, canvas
Emacs Application Framework
A free/libre and open-source extensible framework that revolutionizes the graphical capabilities of Emacs, the key to ultimately Live in Emacs
Stars: ✭ 1,932 (+2409.09%)
Mutual labels:  terminal, browser
Gotty
Share your terminal as a web application
Stars: ✭ 16,070 (+20770.13%)
Mutual labels:  terminal, browser
Leash
Browser Shell
Stars: ✭ 108 (+40.26%)
Mutual labels:  terminal, browser
Color.js
Extract colors from an image (0.75 KB) 🎨
Stars: ✭ 42 (-45.45%)
Mutual labels:  browser, canvas
Exokit
Native VR/AR/XR engine for JavaScript 🦖
Stars: ✭ 809 (+950.65%)
Mutual labels:  browser, canvas
Cast Sh
📟 An instance of your terminal in your browser
Stars: ✭ 151 (+96.1%)
Mutual labels:  terminal, browser
Termly.js
Simple, Extensible, Hackable and Lightweight Javascript Browser Terminal Simulator!
Stars: ✭ 56 (-27.27%)
Mutual labels:  terminal, browser
Diagram
CLI app to convert ASCII arts into hand drawn diagrams.
Stars: ✭ 642 (+733.77%)
Mutual labels:  terminal, canvas
Colorette
Easily set the color and style of text in the terminal.
Stars: ✭ 1,047 (+1259.74%)
Mutual labels:  terminal, browser
Asciichart
Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS, browsers and terminal, no dependencies
Stars: ✭ 1,107 (+1337.66%)
Mutual labels:  terminal, browser
Shadertoy React
6kB "Shadertoy" like react component letting you easily render your fragment shaders in your React web projects, without having to worry about implementing the WebGL part.
Stars: ✭ 74 (-3.9%)
Mutual labels:  canvas
String To Stream
Convert a string into a stream (streams2)
Stars: ✭ 75 (-2.6%)
Mutual labels:  browser
Siriwave
The Apple® Siri wave-form replicated in a JS library.
Stars: ✭ 1,186 (+1440.26%)
Mutual labels:  canvas
Phaser Ce
Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
Stars: ✭ 1,186 (+1440.26%)
Mutual labels:  canvas
Noduino
JavaScript and Node.js Framework for controlling Arduino with HTML and WebSockets
Stars: ✭ 1,202 (+1461.04%)
Mutual labels:  browser

Term-Web

📟 A Simple Terminal UI That Run On The Web

version license size npm Downloads

Screenshot

Demo

Checkout the demo from Github Pages

Install

Install with npm:

$ npm install term-web

Or install with yarn:

$ yarn add term-web
import Term from 'term-web';

Or umd builds are also available:

<script src="path/to/term-web.js"></script>

Or from jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/term-web/dist/term-web.js"></script>

Will expose the global variable to window.Term.

Usage

<div id="term"></div>
var term = new Term({
    // ... options
    container: '#term',
});

Options

{
    // Mounted dom element
    container: '#term',

    // Debug mode
    debug: false,

    // Initial size
    width: 600,
    height: 500,

    // Custom actions
    actions: [],

    // Use the display recorder button
    recorder: true,

    // Is it draggable
    draggable: true,

    // Font size
    fontSize: 13,

    // Font family
    fontFamily: 'monospace',

    // Watermark image url
    watermark: '',

    // Font color
    color: '#b0b2b6',

    // Background color
    background: 'rgb(42, 39, 52)',

    // Title on the topbar
    title: 'Term Web',

    // Entered prefix
    prefix: ',

    // Welcome Message
    welcome: `Last login: ${new Date()}`,

    // Loading tips
    loading: (val) => '<d color="yellow">Loading...</d>',

    // Pixel ratio
    pixelRatio: window.devicePixelRatio,

    // Callback when command is not found
    notFound: (val) => `-bash: <d color='red'>${val}</d>: command not found`,
}

API

term.input(text, isReplace)

  • text is the string to be displayed.
  • isReplace indicates whether to replace the previous record, default is false;

term.output(text, isReplace)

  • text is the string to be displayed.
  • isReplace indicates whether to replace the previous record, default is false;

term.type(text, isExecute)

  • text is the string to be displayed.
  • isExecute Whether to execute immediately after typing, default is true;

term.clear()

Clear all log

term.ask(text)

  • text is the question string to be displayed.
term.ask('How are you ?').then((answer) => console.log(answer));

term.radio(list)

Output radio list

term.radio([
    {
        key: 1,
        text: 'hi',
    },
    {
        key: 0,
        text: 'bye',
    },
]).then((key) => {
    console.log(key);
});

term.checkbox(list)

Output checkbox list

term.checkbox([
    {
        key: 1,
        text: 'hi',
    },
    {
        key: 0,
        text: 'bye',
    },
]).then((key) => {
    console.log(key);
});

Dynamically modify the UI

term.color

Modify font color

term.color = '#fff';

term.background

Modify background color

term.background = '#000';

term.watermark

Modify watermark image

term.watermark = 'img.png';

term.width

Modify terminal width

term.width = 500;

term.height

Modify terminal height

term.height = 500;

Style attribute

The output interface supports multiple styles through a html tag, currently does not support tag nesting effect

color

term.output('<d color="#666">some text</d>');

background

term.output('<d color="#fff" background="red">some text</d>');

border

Select the color attribute or fontColor attribute of the option by default

term.output('<d color="yellow" border>some text</d>');

underline

Select the color attribute or fontColor attribute of the option by default

term.output('<d color="yellow" underline>some text</d>');

del

Select the color attribute or fontColor attribute of the option by default

term.output('<d color="yellow" del>some text</d>');

href

Link jump behavior

term.output('<d href="www.google.com">google</d>');

Common problem

How to use the font after the font file is loaded?

MDN Web Docs - FontFace

Term.font('Font Name', 'path/to/font.ttf').then((font) => {
    var term = new Term({
        fontFamily: font.family,
        // ... options
    });
});

Donations

We accept donations through these channels:

QQ Group

QQ Group

License

MIT © Harvey Zack

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].