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/components

v0.3.0

Published

stylewx rich component library: Markdown directive syntax (:::card / :::gallery / :::carousel …) compiled to WeChat-safe inline-style HTML + SVG/SMIL interactions. Isomorphic (no DOM / no Node-only APIs).

Readme

@stylewx/components

富组件库:用 Markdown 里的 :::name{props} 指令写出卡片、时间线、轮播、封面等排版组件, 渲染成微信公众号真正保留的 HTML

安装

npm i @stylewx/components

组件一览

| 类别 | 组件 | | --- | --- | | 图片位 | imagegalleryimage-cardcarouselcover | | 结构位 | cardtimelinestepscomparequotetocsection-title | | 装饰位 | dividerbadgecalloutbackgroundcanvasdraw | | 交互位 | revealprogresspulse | | 文章级 | end-card(别名 follow) |

用法

import {
  COMPONENT_CATALOG,
  getComponentSpec,
  parseComponents,
  renderDocument,
  htmlToMarkdown,
} from '@stylewx/components'

// 目录:每个组件的 props、语义槽位、示例
for (const spec of COMPONENT_CATALOG) console.log(spec.name, spec.summary)

// 组件示例 Markdown(可直接抄给用户)
const example = getComponentSpec('gallery')?.example

// Markdown(含 ::: 指令)→ 渲染节点树
const nodes = parseComponents(':::card{title="结论"}\n正文支持 **Markdown**\n:::')

// 反向:把渲染出的 HTML 还原成 Markdown(保留 ::: 指令,可无损回导编辑器)
const markdown = htmlToMarkdown(html)

多数场景直接用 @stylewx/corerenderMarkdownToHtml(markdown, theme) 更省事——它会一并处理主题与校验。

交互是怎么做的

微信正文禁用 JavaScript<details> 会被剥离,:target 这类方式也不可靠。 所以这里的交互全部用内联 SVG + SMIL<animate> / <animateTransform> / begin="click")实现, 实测微信完整保留。

自定义组件

支持用 HTML 模板定义自己的组件,模板语法刻意做小: {{prop}}{{prop|raw}}{{body}}{{theme.*}}{{#if}}{{#unless}}{{#each body}}(含 {{this}} / {{@index}})。 保存时会用样例渲染跑一次安全闸门,确保产物仍符合微信约束。


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