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

tencent.jquery.pix.devtool

v1.0.5

Published

通用调试工具与缓存管理模块,适用于 Gamelet/PixUI 项目

Readme

tencent.jquery.pix.devtool

通用调试工具与缓存管理 npm 包,适用于 Gamelet / PixUI 项目。

特性

  • 🛠 悬浮调试面板:可拖拽、可最小化,支持控制台日志拦截、JS 代码执行
  • 📦 缓存管理:查看 / 删除 / 清空由 setNoteCacheInfo 注册的所有缓存

安装

npm install tencent.jquery.pix.devtool

peerDependencies:项目中需自行安装 gamelet-pixui-frametencent.jquery.pix

快速上手

// 1. 引入样式(在项目入口)
import 'tencent.jquery.pix.devtool/src/devtool.scss';

// 2. 初始化(可选配置)
import { initDevTool } from 'tencent.jquery.pix.devtool';
initDevTool({
  proxyConsole: true,  // 是否默认拦截 console(默认 true)
});

面板 API

| 函数 | 说明 | |------|------| | initDevTool(options?) | 初始化面板,接受可选配置项 | | show(visible?) | 显示或隐藏面板,默认 true | | toggle() | 切换面板显示状态 | | enableShortcut() | 注册 Ctrl+Shift+D 快捷键切换面板 | | log(message) | 向面板控制台输出日志(面板未显示时自动打开) |

initDevTool 配置项

| 参数 | 类型 | 默认值 | 说明 | |------|------|--------|------| | proxyConsole | boolean | true | 是否拦截 console.log/warn/error 并显示在面板中 | | appId | string | "" | app 环境下剪贴板写入所需的 appId | | appName | string | "" | app 环境下剪贴板写入所需的 appName |

缓存 API

基础读写

import { setNoteCacheInfo, getNoteCacheInfo, clearNoteCacheInfo } from 'tencent.jquery.pix.devtool';

// 写入
setNoteCacheInfo('myKey', { foo: 'bar' });

// 读取
const val = await getNoteCacheInfo('myKey');

// 删除
await clearNoteCacheInfo('myKey');

批量操作

import { clearAllNoteCacheInfo, clearMultipleNoteCacheInfo } from 'tencent.jquery.pix.devtool';

// 清空所有已注册的缓存
const count = await clearAllNoteCacheInfo();

// 清空指定前缀的缓存
await clearAllNoteCacheInfo('user_');

// 批量删除指定 key
const result = await clearMultipleNoteCacheInfo(['key1', 'key2']);
// result: { success: 2, failed: 0 }

带过期时间的读写

import {
  setNoteCacheInfoWithHours,
  setNoteCacheInfoWithDays,
  getNoteCacheInfoWithExpire,
  clearExpiredNoteCacheInfo,
} from 'tencent.jquery.pix.devtool';

// 写入 2 小时后过期
setNoteCacheInfoWithHours('myKey', data, 2);

// 写入 3 天后过期(支持 0.5 表示半天)
setNoteCacheInfoWithDays('myKey', data, 3);

// 读取(自动处理过期,过期返回 null)
const val = await getNoteCacheInfoWithExpire('myKey');

// 清除一批 key 中已过期的缓存
const cleared = await clearExpiredNoteCacheInfo(['key1', 'key2']);

Key 注册表

import { registerCacheKeys, getAllRegisteredCacheKeys, removeCacheKeys } from 'tencent.jquery.pix.devtool';

// 手动注册历史遗留的 key(使其出现在面板缓存列表中)
registerCacheKeys(['legacyKey1', 'legacyKey2']);

// 获取所有已注册的 key
const keys = getAllRegisteredCacheKeys();

// 从注册表中移除(不删除实际缓存数据)
removeCacheKeys(['legacyKey1']);

通过 setNoteCacheInfo 写入的 key 会自动注册,无需手动调用 registerCacheKeys

环境说明

| 环境 | 缓存底层 | |------|---------| | app(jssdk-appwindow / preprocessor) | GameletAPI.readCookie / writeCookie | | 浏览器 / 模拟器 | sessionStorage |


开发技术细节请参阅 DEVELOPMENT.md