Git Product home page Git Product logo

component-add's Introduction

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.

component-add's People

Contributors

saiyagg avatar zinkey avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.