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 🙏

© 2026 – Pkg Stats / Ryan Hefner

seer_eyou_js

v1.0.1

Published

赛尔号易游插件管理器的js绑定,方便用户使用js开发插件

Readme

seer_eyou_js

赛尔号易游插件管理器的 JS 绑定库,旨在方便用户使用 JavaScript/TypeScript 开发插件。

简介

seer_eyou_js 提供了一个简单易用的 IPC 客户端,允许你的 Node.js 脚本与赛尔号易游插件管理器(通常运行在 TCP 服务器上)进行通信。你可以通过它注册事件监听器以及向管理器发送指令。

安装

npm install seer_eyou_js

使用方法

引入并连接

使用 getIPCClient 获取客户端实例并连接到服务器。默认连接到 127.0.0.1:3000

import { getIPCClient } from 'seer_eyou_js';

// 获取客户端实例 (默认连接 localhost:3000)
const client = getIPCClient();

// 或者指定端口和 IP
// const client = getIPCClient(3000, '127.0.0.1');

监听事件

使用 on 方法注册事件监听器。当插件管理器触发相应事件时,回调函数会被执行。

client.on('eventName', (data) => {
    console.log('收到事件数据:', data);
    // 返回数据给服务器(如果需要)
    return { status: 'ok' };
});

发送指令 (Emit)

使用 emit 方法向插件管理器发送指令或数据。

// 发送数据,不关心回复
client.emit('commandName', { param: 'value' });

// 发送数据并等待回调回复
client.emit('queryData', { id: 123 }, (response) => {
    console.log('收到回复:', response);
});

异步调用 (Acquire)

使用 acquire 方法以 Promise 方式发送数据并等待响应,适合在 async/await 环境中使用。

async function query() {
    const response = await client.acquire('queryData', { id: 123 });
    console.log('收到回复:', response);
}

API 参考

getIPCClient(port?: number, ip?: string): GameClient

获取 GameClient 的单例对象。如果连接已存在且运行中,则返回现有实例,否则创建新连接。

  • port: 服务器端口,默认为 3000
  • ip: 服务器 IP 地址,默认为 '127.0.0.1'

GameClient

on(eventName: string, callback?: (data?: any) => any): void

注册一个事件监听器。当服务器发送该事件时,回调函数会被触发。如果回调函数有返回值,该返回值会被发送回服务器。

emit(eventName: string, data?: any, callback?: (data?: any) => any): void

向服务器发送事件。如果提供了 callback,则会等待服务器的响应。

acquire(eventName: string, data: any): Promise<any>

emit 的 Promise 版本。发送事件并等待响应,返回一个 Promise。

close(): void

关闭与服务器的连接。

status: string

当前连接状态,例如 'running''closed'

许可证

ISC