Coder Social home page Coder Social logo

my-easy-cli's Introduction

脚手架

思路

  • 解耦:脚手架与模板分离
    • 脚手架负责构建流程,通过命令行与用户交互,获取项目信息
    • 模板负责统一项目结构,依赖项管理
    • 脚手架检测模板的版本是否有更新,支持模板的删除与创建

过程

  • pkg.json下的bin字段
bin:配置内部命令对应的可执行文件的位置,配置命令后,npm会寻找对应的可执行文件,然后再node_modules/.bin目录下建立对应的符号连接。
由于node_modules/.bin会在运行时加入到系统的环境变量,因此我们可以通过npm 调用命令来执行脚本。所有node_modules/.bin目录下的命令都可以通过npm run [命令]执行。

- npm link 本地调试

## 使用到的模块 commander.js

my-easy-cli's People

Contributors

ssjtbcf avatar

Watchers

 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.