# wx-get-pages-json

> 获取微信小程序中所有页面对应json文件中的内容并以数组的形式组合成一个新文件。可用以获取每个页面的路径和标题等。

Latest version **1.0.2** (published 2019-10-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install wx-get-pages-json
pnpm add wx-get-pages-json
yarn add wx-get-pages-json
bun add wx-get-pages-json
```

Provides the command `wx-get-pages-json`.

## 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.2 |
| Published | 2019-10-18 |
| First published | 2019-10-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | zhouhuafei |

## Links

- npm: https://www.npmjs.com/package/wx-get-pages-json
- Repository: https://github.com/zhouhuafei/wx-get-pages-json
- Homepage: https://github.com/zhouhuafei/wx-get-pages-json#readme
- Issues: https://github.com/zhouhuafei/wx-get-pages-json/issues
- npm.io page: https://npm.io/package/wx-get-pages-json

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [yargs](https://npm.io/package/yargs.md) ^14.2.0

## Recent versions

- 1.0.2 (latest) — 2019-10-18
- 1.0.1 — 2019-10-17
- 1.0.0 — 2019-10-17

## README

# 功能说明
> 获取微信小程序中所有页面对应json文件中的内容并以数组的形式组合成一个新文件。可用以获取每个页面的`路径`和`标题`等。

# 使用方式1
* 安装
```
npm i --save-dev wx-get-pages-json
```
* 配置
    * 在`package.json`中新增
    ```
    {
      "scripts": {
        "wx-get-pages-js": "npx wx-get-pages-json --entry=./dist/app.json --output=./dist/page.js",
        "wx-get-pages-json": "npx wx-get-pages-json --entry=./dist/app.json --output=./dist/page.json"
      }
    }
    ```
    * entry：app.json的路径
    * output：输出的文件路径
* 运行 - 生成js文件
```
npm run wx-get-pages-js
```
* 运行 - 生成json文件
```
npm run wx-get-pages-json
```

# 使用方式2
* 安装
```
npm i --save-dev wx-get-pages-json
```
* 使用
```
const wxGetPagesJson = require('wx-get-pages-json')
const arr = wxGetPagesJson('./dist/app.json')
console.log(arr) // 所有页面的json集合
```

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