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

c-react-component

v1.0.2

Published

前端基建内容,快速构建项目组件脚手架并发布到 npm 站点。

Readme

创建 React 组件脚手架并发布

启动

  • 安装依赖 npm i;
  • 开发环境 npm start;

开发 && 测试

项目根目录下执行

npm link
npm link c-react-component

实时开发

1.修改 package.json

{
  "main": "src/index.js",
}

发布时再改为

{
  "main": "lib/index.js",
}

2.修改 example/app.js

将本地组件改为打包后依赖包组件。

// import CReactComponent from '../src';
import CReactComponent from 'c-react-component';
import 'c-react-component/lib/main.min.css'; 

3.根目录执行

npm start

这样一边开发,就可以一边查看组件发布后的样子了。

发布

1.查看源地址

npm config list

2.切换到 npm 官方源地址

npm config set registry http://registry.npmjs.org

3.发布

npm whoami # 当前 npm 登录信息
npm run publish

4.取消发布(最好不要,别人可能下载了你的包)

npm unpublish c-react-component --force # 此处为package.json中定义的name字段

下载 && 使用

1.下载

npm i react-demo-component

2.使用方法

import CReactComponent from 'c-react-component';
import 'c-react-component/lib/main.min.css'; // 组件的样式,需要手动导入css文件