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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@zhin.js/adapter-process

v1.0.22

Published

zhin adapter for process

Downloads

959

Readme

@zhin.js/adapter-process

基于进程标准输入输出的 Zhin 机器人适配器,用于命令行环境下的测试和开发。

功能特性

  • 🖥️ 命令行交互界面
  • ⌨️ 标准输入输出处理
  • 🧪 测试和开发友好
  • 📝 简单的消息格式
  • 🔄 实时消息处理

安装

npm install @zhin.js/adapter-process

配置

// zhin.config.ts
export default {
  bots: [
    {
      context: 'process',
      name: 'console-bot', // 机器人名称
    }
  ]
}

使用方式

启动后,直接在命令行中输入消息即可:

$ npm run dev
> 你好
[Bot] 收到消息:你好
[Bot] 回复:Hello World!

消息处理

  • 监听 process.stdin 输入
  • 将输入内容转换为标准消息格式
  • 消息发送只会在日志中显示,不会输出到终端

消息格式

消息对象包含:

  • id: 基于时间戳的消息ID
  • sender.id: 当前进程PID
  • sender.name: 进程标题
  • channel.id: 进程PID
  • channel.type: 固定为 'private'
  • content: 文本消息内容
  • timestamp: 消息时间戳

适用场景

  • 🧪 插件开发测试
  • 🔍 功能调试
  • 📚 学习和演示
  • 🛠️ 开发环境验证

依赖项

  • zhin.js - Zhin核心框架
  • Node.js 内置模块

开发

npm run build  # 构建
npm run clean  # 清理构建文件

注意事项

  • 此适配器仅用于开发和测试
  • 不支持图片、文件等复杂消息类型
  • 消息发送仅在日志中显示