bipolarmorgan / shell.js

:zap: A JavaScript library to create HTML terminals in web pages.

Home Page:https://shelljs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shell.js

npm npm snyk travis coveralls license

A JavaScript library to create HTML terminals in web pages.

Install

$ yarn add shell.js # recommended
$ npm i shell.js
$ bower install shell.js --save

Options

For each Shell instance you can set the following options:

Options Allowed values Description Defaut value
user string The user "user"
host string The host "host"
path string The working directory "~" | "C:\Windows\system32"
style "default"|"ubuntu"|"osx"|"windows" The OS style "default"
theme "dark"|"light" The theme "dark"
responsive boolean Responsiveness true
typed Typed callable Typed.js integration to make shell alive null
commands array The commands list []

Usage

Create a HTML element with a specified ID...

<div id="awesome-shell"></div>

...and pass the CSS selector to the Shell.js constructor:

document.addEventListener('DOMContentLoaded', function() {
    let shell = new Shell('#awesome-shell', {
        user: 'foobar',
        host: 'MacMini',
        path: '/etc/',
        style: 'osx',
        theme: 'dark',
        responsive: false,
        commands: ['First command', 'Second command', '...']
    });
});

Visit the documentation page

Author

Davide Caruso

License

Licensed under MIT.

About

:zap: A JavaScript library to create HTML terminals in web pages.

https://shelljs.io

License:MIT License


Languages

Language:TypeScript 60.6%Language:SCSS 28.7%Language:JavaScript 5.7%Language:HTML 5.0%