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

jx3api-ts

v2.2.1

Published

剑网3 API 的 TypeScript SDK,提供了一套完整的接口封装

Readme

JX3API-TS

剑网3 API 的 TypeScript SDK,提供了一套完整的接口封装,让您能够轻松获取游戏数据。

项目介绍

JX3API-TS 是一个用于访问剑网3游戏相关数据的 API 客户端,基于 TypeScript 开发,提供了完整的类型定义和接口封装,使开发者能够轻松获取和处理游戏数据。

功能特点

  • 🔥 完整的 TypeScript 类型支持,提供智能代码提示
  • 🚀 支持 Promise 和异步/await,简化异步操作
  • 🔌 支持 WebSocket 实时数据订阅
  • 📦 模块化设计,按需引入

安装

npm install jx3api-ts
# 或者
yarn add jx3api-ts
# 或者
pnpm add jx3api-ts

快速开始

HTTP API 使用

import JX3API from 'jx3api-ts';

// 方式一:使用静态类方式
const clientService = new JX3API.JX3api({
  token: 'your_token', // 可选
  ticket: 'your_ticket', // 可选
});

// 查询服务器状态示例
const serverStatus = await clientService.getServerStatus({
  server: '梦江南',
});
console.log(serverStatus);

// 获取活动日历示例
const calendar = await clientService.getActiveCalendar({
  server: '梦江南',
  num: 1,
});
console.log(calendar);

WebSocket 使用

import JX3API from 'jx3api-ts';

// 创建WebSocket实例
const ws = new JX3API.JX3ws({
  wsUrl: 'wss://socket.jx3api.com',
  wstoken: 'your_token',
});

// 监听事件
ws.on('1001', 'key', (data) => {
  console.log('收到世界事件:', data);
});
// 取消监听
ws.off('1001', 'key');

tips

  • key必须保证为唯一值,用于取消该处理函数

API 文档

完整的 API 文档请访问:剑网3 API 文档

主要模块

  • ClientService: 提供 HTTP API 接口调用

    • 服务器相关:服务器状态、维护检查等
    • 角色相关:角色信息、属性、成就等
    • 活动相关:活动日历、名人堂等
    • 交易相关:拍卖行记录、交易行情等
    • 更多接口请参考官方文档
  • JX3WebSocket: 提供 WebSocket 实时数据订阅

    • 世界事件通知
    • 服务器状态变更
    • 更多事件类型请参考官方文档

开发环境要求

  • Node.js >= v22.12.0
  • TypeScript >= 5.7.2

开发相关

# 安装依赖
npm install

# 构建项目
npm run build

# 代码检查
npm run lint

许可证

MIT License