Scan your whole stack
Are you using @xrubik/fabric-to-leafer-cli?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.1.0
@xrubik/fabric-to-leafer-cli was last scanned on 27 Nov 2026 at version 1.1.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.1.0 LATEST | 17 Nov 2026 | No rules fired |
| 0.0.0-stage | 17 Nov 2026 | Not shown |
Findings for v1.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.1.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
批量把 Fabric JSON 转成 Leafer JSON,并支持把静态层烘焙成 PNG 背景,供其他程序直接调用。
pnpm --filter @xrubik/fabric-to-leafer-cli build
依赖 Node 18+。静态图渲染使用 @leafer-ui/node + @napi-rs/canvas,不需要浏览器。
# 普通转换:文件或文件夹都行
fabric2leafer convert ./fabric ./leafer
# 烘焙模式:输出 Leafer JSON + static/*.png
fabric2leafer bake ./fabric ./leafer --pixel-ratio 2
参数:
| 参数 | 说明 | 默认 |
|---|---|---|
<input> |
Fabric JSON 文件,或包含 JSON 的文件夹(递归) | 必填 |
<output> |
输出文件或文件夹 | 文件夹:<input>-leafer / <input>-bake;单文件:同级 leafer/ / leafer-bake/ |
--static-dir |
bake 模式静态背景目录 | static |
--pixel-ratio |
背景图缩放 | 1 |
--asset-root |
本地图片根目录 | 输入所在目录 |
--concurrency |
批量并发数 | 4 |
--no-overwrite |
输出已存在时跳过 | 覆盖 |
--strict |
严格按层切:首个动态图元上方的静态图元全部保留 | 默认重叠检测:不覆盖保留层的静态图元尽量烘焙 |
输出示例:
leafer/
├── page.json
└── static/
└── page.png
page.json 的 header.backgroundImage 指向 static/page.png。这个路径和平台现有的 image/static/xxx.png 约定一致。
bar / button / image / gif / chart / component / lib 等业务图元,文本里的 {参数} 占位符,dyn 有有效配置,action / ctxmenu 非空,script 非空,或组内有动态后代。--strict:第一个动态图元及其上方的所有图元都保留。动态元素运行态移动/变大后,重叠检测模式可能让原本不重叠的背景元素被动态元素盖住,需要按页面实际情况选择。const { convertPath } = require('@xrubik/fabric-to-leafer-cli')
const result = await convertPath('./fabric', './leafer', {
mode: 'bake', // 'convert' | 'bake'
staticDir: 'static',
pixelRatio: 2,
concurrency: 4,
// 可选:退回严格的“首个动态图元以上全部保留”
// strict: true
})
console.log(result.outputs, result.errors)
单文件:
await convertPath('./page.json', './out/page.json', { mode: 'bake' })
返回值 outputs 中每一项包含:
inputFile / outputFilekept / baked(bake 模式)staticImage(bake 模式)warnings(Fabric 转换器的告警)dyn 中的空配置(如 { exprs: null })不会误判为动态。<input 所在目录>/<url>、<asset-root>/<url> 找本地文件。远程图片地址会直接交给 Node 渲染器加载。--no-overwrite 只检查最终 JSON 是否存在;需要重新生成背景图时请先删除旧输出。Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.