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

@hlw-zbzs/core

v1.0.32

Published

核心SDK与类型定义

Readme

@hlw-zbzs/core

直播助手核心 SDK 与基础能力库。

核心模块

  • config: 全局共享配置管理 (跨主进程与微应用)
  • device: 设备与高精硬件信息采集
  • tools: 系统常用工具与路径解析
  • store: 本地持久化配置存储
  • file: 本地文件与下载管理
  • http: Axios 网络请求客户端
  • user: 当前用户信息与 Token 凭证
  • app: 微应用信息与生命周期监听
  • db: NanoSQL 本地数据库管理
  • bus: 微应用跨进程通信总线
  • log: 统一结构化日志与落库管理
  • network: 网络状态与节点延迟监测
  • notice: 系统原生桌面气泡通知
  • hotkey: 微应用全局快捷键管理
  • electron: Electron 原生能力桥接
  • main: 主进程容器与视图管理

快速使用

1. 客户端/微应用调用

import { config, bus, log, network, notice, hotkey } from '@hlw-zbzs/core'

// 1. 读取宿主全局共享参数
console.log(config.container)
console.log(config.isDev)
console.log(config.get('customKey'))

// 2. 跨微应用事件广播
bus.emit('DANMAKU_MESSAGE', { user: '张三', text: '主播好!' })
bus.on('DANMAKU_MESSAGE', (data) => console.log('收到弹幕:', data))

// 3. 结构化日志输出与持久化
log.info('直播间已连接', { roomId: '123456' })

// 4. 网络状态与延迟测速
const pingMs = await network.ping('https://www.baidu.com')

// 5. 桌面原生气泡通知
notice.show({
    title: '大额礼物提醒',
    body: '用户送出了 1 个嘉年华 🎡'
})

// 6. 注册全局快捷键
await hotkey.reg('F8', () => {
    console.log('触发快捷操作')
})

2. 宿主主进程

import { config, ContainerManager, AppManager, mpEvent } from '@hlw-zbzs/core'

// 1. 初始化宿主全局配置 (微应用可实时读取)
config.set({
    container: 'zbzs-container',
    baseUrl: 'http://127.0.0.1:8001/'
})

// 2. 初始化主容器窗口 (已自动集成全局事件总线与热键分发)
new ContainerManager(win, app, globalShortcut)

// 3. 初始化微应用视图管理
new AppManager(win)

// 4. 注册独立弹窗事件
mpEvent()

3. 全局对象

在微应用或渲染进程中,可通过 window.hlw 访问所有核心模块,通过 window.electron 访问原生能力。