/terminal-web

Componente que renderiza una terminal web

Primary LanguageTypeScript

Terminal Web

A web component to simulate the a Linux Terminal.

To list the commands available you can run help

Then you can see commands like:

  • help
  • echo
  • catsay
  • history
  • whoami
  • pwd

Installation

npm i terminal-web

Usage

Via module

import "terminal-web"

Via CDN

<script type="module" src="https://unpkg.com/terminal-web/dist/terminal-web.cjs.production.min.js"></script>

Using the component

Then you can do this:

<terminal-web></terminal-web>

To custom it, you can wrap it with a container, add user and host name.

<div style="width: 450px; height: 150px;">
  <terminal-web username="tom" hostname="ate">
    <div slot="text-line">Good morning!</span></div>
    <div slot="text-line">Welcome to <span style="background-color: teal">Terminal-Web</span></div>
  </terminal-web>
</div>

Note: Notice the slot "text-line"

Try it

You can play with it in this playground