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

@stylewx/theme

v0.5.0

Published

stylewx theme package: zod theme schema (with JSON Schema export), WeChat-safe CSS whitelist, theme → CSS compiler, and preset themes (6 built-in + 20 WeMD ported). Isomorphic (no DOM / no Node-only APIs).

Readme

@stylewx/theme

微信公众号排版主题:zod Schema 校验 + 预置主题 + 编译成微信安全 CSS + 确定性微调。

主题用声明式 JSON 描述(tokens + blocks + 可选的 components 组件级覆盖)。 这个包负责校验它、把 token 引用({{primaryColor}})解析成实际值、编译出可用 CSS, 以及在不调用 LLM 的前提下做确定性微调。

安装

npm i @stylewx/theme

用法

import {
  PRESET_THEMES,
  getPresetTheme,
  validateTheme,
  compileThemeToCss,
  tweakTheme,
} from '@stylewx/theme'

// 取预置主题
const theme = getPresetTheme('magazine')!

// 校验:zod + 微信 CSS 白名单;返回补齐默认值后的安全副本
const { ok, theme: safe, issues } = validateTheme(theme)
if (!ok) throw new Error(issues.map((i) => `${i.path}: ${i.message}`).join('; '))

// 编译成 CSS
const css = compileThemeToCss(safe!)

// 确定性微调(不烧 LLM):改 token、某个 block 的声明,或组件级覆盖
const { theme: adjusted } = tweakTheme(theme, {
  tokens: { primaryColor: '#1f3864' },
  blocks: { h2: { 'border-left': '4px solid {{primaryColor}}' } },
})

预置主题

tech-minimal、business、magazine、gov-red、academic、dark-code, 外加 22 个 WeMD 兼容主题(basic、code-github、aurora-glass 等)。 完整列表就是 PRESET_THEMES。

设计约束

主题里能写哪些 CSS,由微信实际保留的属性决定(来自真实 draft/add → draft/get 实测, 不是社区传闻)。isCssPropertyAllowed() 与 findUnsafeCssValue() 会拦掉 position、filter、url(#…) 这类会被剥离、甚至导致发布报错的写法。


属于 stylewx —— 把 Markdown 排成微信公众号文章的工具链。MIT License.