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

@easytwin/cli

v0.0.53

Published

创建一个新的 EasyTwin 组件开发项目。

Readme

easytwin-cli

CLI 命令

init - 初始化项目

创建一个新的 EasyTwin 组件开发项目。

pnpm easytwin-cli init <project-name>

示例

pnpm easytwin-cli init my-components
cd my-components
pnpm install

该命令会创建一个基于 pnpm 的 monorepo 仓库,包含:

my-components/
├── packages/              # 组件包目录
├── package.json           # 项目配置(已包含 @easytwin/runtime、@easytwin/runtime-frontend、@easytwin/cli)
├── pnpm-workspace.yaml    # workspace 配置
├── tsconfig.base.json     # TypeScript 基础配置
├── eslint.config.js       # ESLint 配置
├── jest.config.ts         # Jest 测试配置
└── .gitignore

create - 创建组件包

在当前项目的 packages/ 目录下创建组件包。

pnpm easytwin-cli create <component-type> [-t template] [-u url]

参数说明

| 参数 | 说明 | 默认值 | | ------------------ | ------------------------------------------------------- | ------------------------ | | <component-type> | 组件类型名(如 thermometeralarm-panel) | 必填 | | -t, --template | 模板类型:example(简单组件)或 digital(数字要素) | example | | -u, --url | 后端接口地址 | http://twin.easyv.test |

示例

# 创建简单组件
pnpm easytwin-cli create thermometer

# 创建数字要素组件(支持子要素)
pnpm easytwin-cli create alarm-panel -t digital

命名转换

| 输入 | 组件包目录 | 类名 | | ------------- | --------------------------------- | ---------------------- | | thermometer | easytwin-components-thermometer | ThermometerComponent | | alarm-panel | easytwin-components-alarm-panel | AlarmPanelComponent |

upload - 上传组件

将构建好的组件上传到指定环境。

pnpm easytwin-cli upload [options]

参数说明

| 参数 | 说明 | | ------------------ | -------------------------------------- | | -l, --local | 上传到本地 bundled/ 目录 | | -f, --force | 强制覆盖已存在的同版本组件 | | -m, --mode <env> | 环境选择:devtestpreprod | | --message <text> | 版本更新说明 |

示例

# 上传到本地(开发调试)
pnpm easytwin-cli upload -l

# 上传到开发环境
pnpm build && pnpm easytwin-cli upload -f --mode dev --message "新增温度显示功能"

# 上传到生产环境
pnpm build && pnpm easytwin-cli upload --mode prod