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

@wangofnextdoor/zlblog

v1.0.0

Published

浙里办日志和老年模式工具包

Readme

@wx/zlblog

浙里办日志和老年模式工具包

安装

npm install @wx/zlblog

使用方法

初始化浙里办日志

import { initZwlog, zwlogRecord } from '@wx/zlblog';

// 初始化日志
initZwlog('user123', '张三');

// 记录点击事件埋点
zwlogRecord('user123', '张三');

老年模式

import { elderStyle, toggleElderStyle, isElderMode } from '@wx/zlblog';

// 初始化老年模式
elderStyle();

// 切换老年模式
toggleElderStyle('elder'); // 或 'normal'

// 检查是否为老年模式
const isElder = isElderMode();

配置管理

import { ConfigManager } from '@wx/zlblog';

// 创建配置管理器
const configManager = new ConfigManager({
  miniAppId: 'custom_app_id',
  miniAppName: '自定义应用名称'
});

// 获取配置
const config = configManager.getConfig();

// 更新配置
configManager.updateConfig({
  serviceCode: 'new_service_code'
});

工具函数

import { 
  getCurRoute, 
  getNavigationBarTitleText, 
  getQueryVariable 
} from '@wx/zlblog';

// 获取当前路由
const route = getCurRoute();

// 获取页面标题
const title = getNavigationBarTitleText();

// 获取URL参数
const param = getQueryVariable('key');

API 文档

日志相关

initZwlog(userId: string, userNickName: string)

初始化浙里办日志

zwlogRecord(userId: string, userNick: string)

记录点击事件埋点

isLoad(bIsAlipayMini?: boolean)

登录跳转

getCurRoute(): string

获取当前页面路由

getNavigationBarTitleText(): string

获取页面标题

老年模式相关

elderStyle()

初始化老年模式

toggleElderStyle(uiStyle: UiStyle)

切换老年模式

isElderMode(): boolean

检查是否为老年模式

getCurrentUiStyle(): UiStyle

获取当前UI样式

setCssVar(prop: string, val: string, dom?: HTMLElement)

设置CSS变量

配置相关

ConfigManager

配置管理类

工具函数

getQueryVariable(name: string): string | null

获取URL查询参数

类型定义

interface AppConfig {
  miniAppId: string;
  miniAppName: string;
  appKey: string;
  serviceCode: string;
  servicePwd: string;
  appCode: string;
  accessKey: string;
  secret: string;
}

type UiStyle = 'elder' | 'normal';

注意事项

  1. 此包需要在浙里办环境中使用
  2. 老年模式功能需要ZWJSBridge支持
  3. 部分功能只能在浏览器环境中使用
  4. 需要确保相关的外部依赖已正确加载