# kzmp-cli

> 小程序模板生成器

Latest version **1.0.4** (published 2018-07-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install kzmp-cli
pnpm add kzmp-cli
yarn add kzmp-cli
bun add kzmp-cli
```

Provides the command `kzmp`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2018-07-16 |
| First published | 2018-07-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 101 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | konglx |

## Links

- npm: https://www.npmjs.com/package/kzmp-cli
- npm.io page: https://npm.io/package/kzmp-cli

## Dependencies (2)

- [fs-extra](https://npm.io/package/fs-extra.md) ^6.0.1
- [commander](https://npm.io/package/commander.md) ^2.16.0

## Recent versions

- 1.0.4 (latest) — 2018-07-16
- 1.0.3 — 2018-07-15
- 1.0.2 — 2018-07-15
- 1.0.1 — 2018-07-15
- 1.0.0 — 2018-07-13

## README

## mp-cli

### Use

#### Build a page to a wxml file

```js
kzmp -p page.json

// page.json
[
    {
        "eid":"11",
        "name":"kz-button",
        "value":{
            "text":"按钮",
            "height": 100
        }
    }
]

// generate a file named index.wxml
<wxs module="pageData">
var data = [{"text":"按钮", "height": 100}];
module.exports.data = data;
</wxs>
<kz-button text="{{pageData.data[0].text}}" height="{{pageData.data[0].height}}"/>
```

#### Build a complete miniprogram project

```js
// need mp-templates
npm install mp-templates --save-dev

// app is dir of some page json config
// tree app
// app
// ├── detail.json
// └── index.json
kzmp -P app mp

// we will get a mp project
dist/mp
├── app.js
├── app.json
├── app.wxss
├── components
│   ├── good-desc
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── index.json
│   │   ├── index.wxml
│   │   └── index.wxss
│   ├── good-info
│   │   ├── README.md
│   │   ├── images
│   │   │   └── qd.png
│   │   ├── index.js
│   │   ├── index.json
│   │   ├── index.wxml
│   │   └── index.wxss
│   ├── kz-swiper
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── index.json
│   │   ├── index.wxml
│   │   └── index.wxss
│   └── shop-list-easy
│       ├── README.md
│       ├── index.js
│       ├── index.json
│       ├── index.wxml
│       └── index.wxss
├── jsconfig.json
├── pages
│   ├── detail
│   │   ├── index.js
│   │   ├── index.json
│   │   ├── index.wxml
│   │   └── index.wxss
│   └── index
│       ├── index.js
│       ├── index.json
│       ├── index.wxml
│       └── index.wxss
├── project.config.json
├── typings
│   └── wx.d.ts
└── utils
    └── util.js
```

### Name

```js

// 目前的设计
button => @kuaizhan/button
shop-list/shop-list-easy => @kuaizhan/shop-list/shop-list-easy


// Extend: download from github
@github.com/konglx90/mp-templates/components/button

// Extend: other space
@konglx/button

```

### Test
`npm run build && node lib/input.js -P test/app`

---
_Source: https://npm.io/package/kzmp-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
