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

@efox/emp-lib-base

v0.0.5

Published

## 目录

Readme

EMP Lib Base

目录

客户端协议

包含ME、多玩语音、寻你协议,部分功能对应app并未支持,将采用兼容处理

协议描述

请求实例

  • 普通请求
  • 营收请求
  • 多语言请求
  • 阿里云Oss上传

普通请求

// example
type API_DATA<T> = {
  code: number
  data: T
  message: string
}

const request = createGetter(`//unionvoice-act.joyyinc.com`)

const fightMonster = (data: {
  sid: number
  ssid?: number
  zodiacId: number
}): Promise<
  API_DATA<{
    bizId: number
    userId: number
    userPropCnt: number
    sid: number
    ssid: number
    zodiacId: number
    zodiacStatus: 0 | 1 | 2 | 3
    zodiacRealHp: number
    resultMsg: string
    awardName: string
  }>
> => request(`/api/zodiac/attackZodiac`, data).catch(err => err)

营收请求

type API_DATA<T> = {
  code: number
  data: T
  message: string
}

const request = createGetter(`//unionvoice-act.joyyinc.com`)

const fightMonster = (data: {
  sid: number
  ssid?: number
  zodiacId: number
}): Promise<
  API_DATA<{
    bizId: number
    userId: number
    userPropCnt: number
    sid: number
    ssid: number
    zodiacId: number
    zodiacStatus: 0 | 1 | 2 | 3
    zodiacRealHp: number
    resultMsg: string
    awardName: string
  }>
> => request(`/api/zodiac/attackZodiac`, data, {turnover:true}).catch(err => err)

多语言请求

const getChristmasRankConfig = langGetter('/ME1/christmasRank/zh-hans.json')

阿里云Oss上传

需要区分业务,目前只接入me

OssClient实例

import {uploadOss} from 'src/helpers/fetch'

const onChange = async (e: any) => {
  const file: File = e.target.files[0]
  const {OssClient, OssData} = await uploadOss()
  try {
    const {url} = await OssClient.put(OssData.fileName, file)
  } catch (e) {
    console.error(e)
  }
}

// template
<input type='file' onChange={onChange} />

service通道连接

// init
import {SvcAssemble} from '@emp-react-lib/base/helpers/service'
import {BIZ_ID} from '@emp-react-lib/base/helpers/browser'

const ClientApi = await getAppApi(BIZ_ID)
  const appid = '12345'
  const {uid} = await ClientApi.getUserInfo()
  const {otp} = await ClientApi.getUserTicket()

await SvcAssemble.init({
    appid,
    uid: uid + '',
    otp,
    region: 'cn',
    groupType: Number('xxxxx'),
    groupId: (await ClientApi.getRoomId())[0],
  })

// receiver data
import {useServiceData} from '@emp-react-lib/base/helpers/service'
import {PBDecode} from '@emp-react-lib/base/helpers/utils/pb'

// hook
useServiceData(
  `12345_${fnName_SvcName}_${messageName}`,
  async data => {
    const decodeData = PBDecode({
      clzName: 'ZodiacData',
      root: await import('src/proto/zodiac_broadcast.proto'),
      data,
    })
  },
  self,
)

常量

import {USER_HEAD, UNION_HEAD, UDB_APPID, SVC_GROUP_TYPE} from '@emp-react-lib/base/helpers/constant'

// 默认头像
USER_HEAD

// 工会头像
UNION_HEAD

// UDB APPID
UDB_APPID

// SVC_GROUP_TYPE
SVC_GROUP_TYPE

通用函数

//