use-template

模版生成器

Usage no npm install needed!

<script type="module">
  import useTemplate from 'https://cdn.skypack.dev/use-template';
</script>

README

template

配置模版渲染器

Installation

npm install use-template

使用

const templateRender = require('use-template');
templateRender({
  template: 'ascp-query-list',
  variable: {
    group: 'ascp-comp',
    project: 'test-template',
    version: '5.0.0',
    author: 'kaihao.zkh',
    description: '',
  },
});

模版目录结构

会默认读取 template 文件夹里面的内容复制到当前目录

├── README.md
├── tpl.config.js
├── tplrc.js
└── template
  ├── __gitignore
  ├── ...

API

参数 说明 类型 默认值
template 模版名称 String
downloadType 下载方式(clone 或者 http) String http
variable 模版内容变量 Object {}
dest 模版初始到对应的目的目录 String 当前文件夹
contentDir 本地 copy String
templateConf 模版初始化生命周期 Object {}