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

component-add

v0.1.6

Published

component add

Downloads

44

Readme

component-add

NPM version


模块使用工具:

  1. 将 npm 模块下的 src 文件夹里的内容 下载到指定文件夹,

  2. 安装模块需要的依赖到当前项目中。

跟 npm install 区别:

  • npm install 将模块安装到 node_modules,直接使用模块的接口,不可进行编辑模块。

  • component-add 将模块下载到指定的文件夹,模块的依赖被安装成为到项目的依赖。可直接编辑模块代码。

为什么需要:

项目中类似的场景、组件、模式需要一种沉淀的方式,而 “安装组件” 的方式需要提炼抽象出组件的 api,比较适合于通用基础组件。而业务中的需求经常是 要用,但要修改,这种情况是不适合做成普通组件用 npm install 来安装使用的。所以采用 component-add 来下载模块的 src 文件夹,安装模块的依赖到项目中。这样,就可以方便使用、修改这些场景、组件、模式的沉淀。

cli:

$ npm install -g component-add
$ component-add module dir

eg:

$ component-add rcf ./src/component/

api

var componentAdd = require("component-add");
componentAdd(module, dir, [options]);

options:

  • cwd: default is process.cwd()

eg:

componentAdd('rcf', './').then(() => {
  console.log('success');
}).catch(err => {
  conole.log(err);
})

License

Component is released under the MIT license.