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

@nova-infra/d2c-cli

v1.0.4

Published

Agent-friendly Figma design extraction CLI

Readme

@nova-infra/d2c-cli (nova-d2c)

Agent-Friendly Figma 设计提取 CLI。

从 Figma 提取平台无关的设计数据(节点、组件、变量、样式、布局树)以及图片资源,供 AI Agent 驱动的 D2C 工作流使用。

官网与文档:

  • 官网:https://nova-d2c.pages.dev
  • 文档:https://nova-d2c.pages.dev/docs
  • npmjs:https://www.npmjs.com/package/@nova-infra/d2c-cli

安装

npm install -g @nova-infra/d2c-cli

配置 Figma Token

从 https://figma.com/developers 获取 Personal Access Token。

推荐设置为全局环境变量(zsh):

echo 'export FIGMA_TOKEN=figd_your_token_here' >> ~/.zshrc && source ~/.zshrc

也可以在命令行里用 --token 显式传入。

快速开始

# 1) 检查环境
nova-d2c doctor

# 2) 发现结构(推荐入口)
nova-d2c explore "https://www.figma.com/design/xxx"

# 3) 提取设计数据
nova-d2c get "https://www.figma.com/design/xxx" --node-id 1:2

# 4) 导出图片资源
nova-d2c images "https://www.figma.com/design/xxx" --node-id 1:2 --output ./assets

命令

doctor

检查 Token、API 连通性与缓存状态。

nova-d2c doctor

explore

分析文件结构并输出推荐节点与后续建议命令。

nova-d2c explore "https://www.figma.com/design/xxx"

get

提取设计数据。

常用示例:

# 提取指定节点
nova-d2c get "https://www.figma.com/design/xxx" --node-id 1:2

# 过滤输出
nova-d2c get "https://www.figma.com/design/xxx" --node-id 1:2 --only components
nova-d2c get "https://www.figma.com/design/xxx" --node-id 1:2 --only variables
nova-d2c get "https://www.figma.com/design/xxx" --node-id 1:2 --only styles
nova-d2c get "https://www.figma.com/design/xxx" --node-id 1:2 --only tree

# 内联解析后的样式(减少下游 join 成本)
nova-d2c get "https://www.figma.com/design/xxx" --node-id 1:2 --resolved

images

从指定节点导出 PNG/SVG 图片资源。

nova-d2c images "https://www.figma.com/design/xxx" \
  --node-id 1:2,3:4 \
  --output assets/ \
  --image-format png \
  --scale 2

选项速查

| 选项 | 说明 | |------|------| | --node-id | 节点 ID,逗号分隔 | | --only | pages components variables styles tree resolved | | --format | yaml json md compact | | --depth | 节点遍历深度 | | --resolved | --only resolved 的快捷方式 | | --output | 写入文件路径 | | --no-cache | 跳过缓存,强制重新获取 | | --token | 显式传 Figma Token | | --image-format | pngsvg | | --scale | PNG 缩放倍率 |

缓存

get 会将首次提取结果缓存约 5 分钟,后续使用 --only 切不同视图时不会重复请求 Figma API。

License

MIT