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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dingdao/psuip-generate-sdk

v0.0.11

Published

A PSUIP generate sdk

Downloads

981

Readme

PSUIP Generate SDK

PSUIP(Particle Service UI Protocol)是一套用于描述企业级 UI 结构与内容的语义协议。本 SDK 将 PSUIP 文本转化为标准化「八要素」数据结构,可用于「八要素」渲染引擎用于渲染。

核心能力

  • 语义解析:将 PSUIP 文本解析为布局、文本、按钮、卡片、表格、标签、图标等 UI 元素。
  • 设计令牌:通过 seed 自定义主题,动态生成颜色、字体、尺寸等设计令牌。
  • 可视化增强:内置上千枚矢量图标、表格/图表渲染器以及按钮、卡片等组件生成器。

安装

npm install psuip-generate-sdk
# 或
yarn add psuip-generate-sdk

快速上手

以下示例使用中立的内容片段,展示如何一次性获取标准八要素 JSON:

import PSUIPGenerator from "psuip-generate-sdk";

const eightElements = PSUIPGenerator({
  psuip: `
  <card>
  ### 智能协同平台
  - ✅ 模块化业务组件
  - ✅ 多终端一致体验
  - ✅ 实时数据洞察
  </card>

  <layout:row>
  我们提供端到端的数字化实施与 7x24 支持。
  </layout:row>
  `,
});

console.log(eightElements); // 八要素对象

API

PSUIPGenerator(options)

| 参数 | 类型 | 说明 | | --- | --- | --- | | psuip | string | 必填,符合 PSUIP 语法的文本内容。 | | seed | object | 选填,自定义品牌/主题种子,内部将衍生出颜色、尺寸、字体等设计令牌。 |

自定义主题(seed 示例)

const customTheme = PSUIPGenerator({
  psuip: `# Hello PSUIP`,
  seed: {
    shape: 5,
    degree: 5,
    font: 5,
    material: 5,
    color: '#0000FF'
  },
});

传入 seed 后,SDK 会:

  1. 通过 calculateTokens 生成设计令牌;
  2. 注入动态 Token 系统解析 PSUIP;

构建与发布

  • npm run build:使用 Rollup 产出 dist/index.js
  • npm publish:发布前会自动执行 prepublishOnly 完成构建。

许可证

MIT License © Dingdao