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

y-command

v1.0.2

Published

a Command library just for y-terminal

Downloads

1

Readme

✨ 特性

y-command是一个 为y-terminal 服务的命令集,采用最新的 Vite4+TypeScript 为技术栈, 可以实现定制化个人浏览器主页。

使用

  • 安装
pnpm y-command
  • 在项目中引入
// src/core/commandRegister.ts

import { emojiCommand } from '@y-command/commands'

const commandList: CommandType[] = [
  emojiCommand
]

命令开发

命令开发写在目录commands/src下,比如muyu命令目录如下

-- components
  -- src
     -- moyu
        -- MoYuBox.vue 命令结果回显
        -- moyuCommand.ts 命令编写
     -- index.ts 导出全部组件
  -- index.ts 命令集入口文件

摸鱼命令 开发示例


<template>
  <div style="margin: 8px 0">
    <iframe
      :src="currentGame"
      class="main"
      frameborder="no"
      marginwidth="0"
      marginheight="0"
    />
  </div>
</template>

<script setup lang="ts">
const gameList = [
  'https://haiyong.site/moyu/shitoujiandaobu/',
  'https://haiyong.site/moyu/lion.html',
  'https://haiyong.site/moyu/shengchengshu.html',
  'https://haiyong.site/moyu/zhipaijiyi.html',
  'https://haiyong.site/moyu/doumao.html',
  'https://haiyong.site/moyu/dadishu.html',
  'https://haiyong.site/moyu/laganziguoguan/',
  'https://haiyong.site/moyu/danzhu.html',
  'https://haiyong.site/moyu/feiji.html',
  'https://haiyong.site/moyu/doudizhu.html',
  'https://haiyong.site/moyu/tiaofangzi.html',
  'https://haiyong.site/moyu/SpaceHuggers/',
  'https://haiyong.site/moyu/weijing/'
]

const currentGame = gameList[Math.floor(Math.random() * gameList.length)]
</script>

<style scoped>
.main {
  width: 100%;
  height: 80vh;
  min-height: 600px;
}
</style>

命令编写


import { CommandType } from '../../command.d'
import { defineAsyncComponent } from 'vue'
import ComponentOutputType = YiTerminal.ComponentOutputType

/**
 * 摸鱼命令
 * @author pjy
 */
const moyuCommand: CommandType = {
  func: 'moyu',
  name: '摸鱼',
  options: [],
  collapsible: true,
  action(options: any, terminal: any) {
    const output: ComponentOutputType = {
      type: 'component',
      component: defineAsyncComponent(() => import('./MoYuBox.vue')),
      props: {}
    }
    terminal.writeResult(output)
  }
}

export default moyuCommand
export { moyuCommand }

导出命令示例(src/index.ts)

export { moyuCommand } from './moyu/moyuCommand'

命令集入口文件(commands/index.ts)

export * from "./src/index"

运行命令,在play中开发调试命令 注意在core的commandRegister.ts中对开发命令进行注册

// src/core/commandRegister.ts

import { emojiCommand } from '@y-command/commands'

const commandList: CommandType[] = [
  emojiCommand
]

了解更多

终端命令行浏览器 y-terminal 是什么?

一个很特别的浏览器主页,支持使用输入命令的方式来操作,目标是帮你在一个 web 终端中高效完成所有的事情!(all in one)

此外,它也是一个功能强大的 web 终端组件。开发者可以在它的基础上定制自己的 web 终端,并且可以在终端中集成任何内容!

如果你是一名程序员,相信你会爱上它~

1 分钟上手使用

请打开网站:y-terminal

然后在网站内输入命令:

help 回车, 显示所有支持的命令

使用 help 命令英文名 可以查询某命令的具体用法,如:help search

使用 shortcut 可以查看所有的快捷键。

尽情探索吧~