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

@tingxi8087/paper-ink-cli

v0.2.1

Published

Install Paper Ink component source into your React TypeScript project

Readme

Paper Ink CLI

将 Paper Ink 组件源码安装到你的 React + TypeScript 项目。与组件包来自同一份实现,支持按需选择、共享依赖解析和本地二次开发。MIT 许可,CLI 零运行时 npm 依赖。

在线文档 · 快速开始 · GitHub

安装源码

要求 Node.js 20+、React 18+ 和 TypeScript。在消费项目根目录执行:

npx @tingxi8087/paper-ink-cli init
npx @tingxi8087/paper-ink-cli add button input --dry-run
npx @tingxi8087/paper-ink-cli add button input

也可以使用 pnpm dlx @tingxi8087/paper-ink-cli,或安装 CLI 后使用 paper-ink 命令。无需安装 paper-ink 组件包。

从消费项目的 src/App.tsx 引入:

import { Button, Input } from './components/paper-ink';
import './components/paper-ink/style.css';

export default function App() {
  return <><Input placeholder="可以直接修改源码" /><Button>保存</Button></>;
}

有 src 时默认安装到 src/components/paper-ink,否则为 components/paper-ink。生成的内部引用是相对路径,适用于 Vite 等 bundler 模式的 React TypeScript 项目。

命令

  • init --path src/ui/paper-ink:指定源码目录,不修改项目别名和应用入口。
  • add button input modal:添加组件及共享依赖;Modal 要求消费项目有兼容的 ReactDOM。
  • list:查看可安装条目。
  • --cwd /absolute/path/to/your-app:操作指定项目。
  • --dry-run:预览,不写文件、不安装依赖。
  • --no-install:写入源码,由你手动安装缺失的 npm 依赖。
  • --overwrite:明确替换已安装的源码。
  • --help / --version:查看帮助和版本。

CLI 根据项目配置与锁文件识别 npm、pnpm、Yarn 或 Bun,自动解析组件的源码和 npm 依赖。共享模块安装一次,不需要手动复制文件。

修改与升级

源码属于你的项目,可直接修改。重复添加默认保留本地修改,无归属冲突会停止操作。请一起提交源码、paper-ink.json 和 paper-ink.lock.json。当前不提供自动合并上游改动的更新命令。

组件包与源码拥有独立的主题上下文,一个组件树中建议保持同一种来源。

仓库开发

pnpm build:registry
pnpm cli init --cwd /absolute/path/to/your-app
pnpm cli add button input --cwd /absolute/path/to/your-app

常用组件 API 参考 Ant Design,采用独立实现,不依赖 antd,支持范围以组件文档为准。

MIT License。