泰尔莫
termo 是一个简单的终端模拟器,可用于在您的网站上创建类似终端的界面。它的灵感来自 stripe.dev 中的终端模拟器。它是 xterm.js 之上的包装器。
演示
查看
演示和文档。
github
特征
[x] 可自定义的终端标题、提示、字体和主题 [x] 为终端设置欢迎消息 [x] 添加并执行任何 javascript 作为命令 [x] 控制音效 [x] 获得对终端 (xterm.js) 的完全访问权限 [x] 将终端设置为停靠/浮动模式安装
在您的 html 文件中包含以下脚本标记。
1
<script src="https://cdn.jsdelivr.net/gh/rajnandan1/termo/dist/termo.min.js"></script>
快速入门
通过传递一个对象来创建 termo 的新实例。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const myTermo = new termo({
title: Termo,
welcomeMessage: Welcome to Termo,
commands: [
{
command: hello,
description: Says hello,
action: async (terminal, args) => terminal.write(
Hello! + args.join( )),
},
],
});
myTermo.create();
myTermo.show();
以上就是为浏览器构建了一个 cli的详细内容,更多请关注php中文网其它相关文章!