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

yqg-infra-kit

v1.3.5-beta.1

Published

一个支持跨框架的业务组件和SDK工具包,专为infra团队设计。提供基于Web Components的跨平台解决方案,支持Vue、React、Angular、原生JavaScript等任何现代前端框架。

Readme

Infra Kit

一个支持跨框架的业务组件和SDK工具包,专为infra团队设计。提供基于Web Components的跨平台解决方案,支持Vue、React、Angular、原生JavaScript等任何现代前端框架。

📦 安装

npm install @yqg/infra-kit
# 或
yarn add @yqg/infra-kit
# 或
pnpm add @yqg/infra-kit

🏗 核心技术方案

整体架构

┌─────────────────────────────────────────────────────────┐
│                     使用层(任意框架)                    │
│         Vue / React / Angular / 原生 JavaScript          │
└─────────────────────────────────────────────────────────┘
                            ▲
                            │
┌─────────────────────────────────────────────────────────┐
│                   接入层(多种方式)                      │
│   Web Components | Vue Components | SDK (动态初始化)      │
└─────────────────────────────────────────────────────────┘
                            ▲
                            │
┌─────────────────────────────────────────────────────────┐
│                   组件层(Vue 3 实现)                    │
│   CellButton | CopyButton | ManualLink | AI Chat Widget  │
└─────────────────────────────────────────────────────────┘
                            ▲
                            │
┌─────────────────────────────────────────────────────────┐
│                   基础层(工具和依赖)                    │
│      Vue 3 | Ant Design Vue | Interact.js | Vite        │
└─────────────────────────────────────────────────────────┘

使用方式

一:Web Components

适用场景:跨框架、多技术栈项目

<!-- 在任何框架中使用 -->
<template>
  <cell-button color="#1677ff" locale="zh"></cell-button>
  <copy-button content="要复制的内容" type="primary"></copy-button>
</template>

<script setup>
import { registerComponents } from '@yqg/infra-kit'

// 注册组件
registerComponents(['cell-button', 'copy-button'])
</script>

优点

  • ✅ 真正的跨框架
  • ✅ 标准化、未来可期
  • ✅ 样式隔离(可选)

缺点

  • ❌ 属性只能传字符串(需要序列化)
  • ❌ 某些老旧浏览器需要 polyfill

二:SDK 动态初始化

适用场景:浮动组件、全局功能(如 AI 助手)

import { init } from '@yqg/infra-kit/ai-chat-sdk'

// 一行代码初始化
init({
  botCode: 'YOUR_BOT_CODE',
  userId: 'USER_ID',
  themeColor: ['#667eea', '#764ba2'],
  position: { bottom: '20px', right: '20px' },
  enableDrag: true
})

优点

  • ✅ 使用极简单
  • ✅ 自动管理生命周期
  • ✅ 支持动态配置