Coder Social home page Coder Social logo

autocode's Introduction

autocode

copy template code directory or file into your business module directory. 复制模板代码目录或文件到您的业务模块目录.

###How to use?

  1. 全局安装:
    npm install -g iguzhi-autocode
  2. 进入你的项目工程根目录, 运行:
    autocode init
    该方法会在根目录下自动生成__.autocode__文件夹及其子文件夹和文件
  3. 进入__.autocode__目录, 编辑__config.json__, 设置您的个人信息、您想自动生成的模块所存放的目标目录和模块名的对应关系
    配置文件中默认使用__.autocode/tpl__作为您的代码模板目录, 您也通过修改这里的配置实现自定义自己的代码模板目录
  4. 把你的代码模板放入上一步配置的代码模板目录里
  5. 运行:
    autocode yourModule yourCustomModuleName

###Placeholder

使用双花括号作为占位符: {{yourVariable}}

###Filter 占位符支持过滤器, 使用|作为过滤器开关: {{yourVariable|yourFilter}}
目前支持五种过滤器: capitalizexapitalizecamelizetoLowerCasetoUpperCase

###Inner Variable

autocode包含如下内置变量: __filepath____filename____date____moduleprefix__, 这些变量可用于代码模板内.

  • __moduleprefix__: 该变量的值是上一步的 yourCustomModuleName
  • __filepath__: 生成的文件的路径
  • __filename__: 生成的文件名
  • __date__: 生成文件的日期

###Additional

在上述How to use?第5步中的yourModule对应于代码模板目录下各子目录名.
比如 .autocode/tpl/ui 对应的yourModule为__ui__

autocode's People

Contributors

southwhale avatar

Stargazers

 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.