npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-web-terminal

v3.3.2

Published

A beautiful web-side command line window plugin (native simulation). 一个漂亮的网页命令行插件(原生模拟)

Downloads

851

Readme

中文版 | English

vue-web-terminal

A web-side command line plugin built by Vue, supports multiple message formats such as tables, json, and codes, supports custom message styles, command line libraries, typing search prompts, etc., and simulates native terminal support ← → cursor toggle and ↑ ↓ history command toggle.

:tada: The new document is now available. It's more detailed and more friendly, welcome to experience it: https://tzfun.github.io/vue-web-terminal/

Feature Support

  • Supported message formats: plain text, table, json, code/multi-line text, html, ansi
  • Supports real-time content display and appending, and can create simple animation effects
  • Support user question and answer input
  • Support online text editing
  • Support Highlight, Codemirror code highlighting
  • Support window dragging and fixing
  • Support ← → cursor key switching and ↑ ↓ key history command switching
  • Support fullscreen
  • Support command input prompts
  • Support logging group folding
  • Supports multiple styles of slots, customizable styles
  • Supports themes, with built-in dark and light themes by default, and you can also customize themes
  • Provides a rich set of JS APIs, almost all functions can be simulated by APIs to simulate non-human operations
  • Supports Vue2/Vue3

vue-web-terminal

Short description:

It does not have the ability to execute a specific command. This ability needs to be implemented by the developer. What it is responsible for is to get the command to be executed from the user in the form of an interface, and then hand it over to the developer to implement and execute. After that, hand it over to show it to the user

Online Experience

You can learn about some of the features of this plugin through the Online Experience, or try editing the code and previewing it on Edit Vue Template.

Document

Please go to Document

Quick Start

Install vue-web-terminal by npm. The 2.x.x version corresponds to vue2, and the 3.x.x version corresponds to vue3. It is recommended to download the latest version corresponding to the main version.

#  install for vue2
npm install [email protected] --save

#  install for vue3
npm install [email protected] --save 

Use Terminal plugin in main.js

import Terminal from 'vue-web-terminal'

// for vue2
Vue.use(Terminal)

// for vue3
const app = createApp(App).use(Terminal)

Example:

<template>
  <div id="app">
    <terminal name="my-terminal" @exec-cmd="onExecCmd"></terminal>
  </div>
</template>

<script>
  import Terminal from "vue-web-terminal"

  export default {
    name: 'App',
    components: {Terminal},
    methods: {
      onExecCmd(key, command, success, failed) {
        if (key === 'fail') {
          failed('Something wrong!!!')
        } else {
          let allClass = ['success', 'error', 'system', 'info', 'warning'];

          let clazz = allClass[Math.floor(Math.random() * allClass.length)];
          success({
            type: 'normal',
            class: clazz,
            tag: 'success',
            content: command
          })
        }
      }
    }
  }
</script>

<style>
  body, html, #app {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
  }
</style>

Contact Author

I am a backend coder who happens to have some knowledge of frontend. I developed this plugin out of personal interest.

If you have good ideas for code optimization or functions and are willing to contribute code, please submit PR, If you have any questions about the use of the plugin or find bugs, please submitissue.

Contact me (Add please note vue-web-terminal)

📮 Email: [email protected]

WeChat: beifeng-tz

License

Apache License 2.0