# wpak

> 通过`命令行`或`模块`方式对`小游戏`项目打包

Latest version **1.0.9** (published 2023-05-23) · 0 weekly downloads

## Install

```sh
npm install wpak
pnpm add wpak
yarn add wpak
bun add wpak
```

Provides the command `wpak`.

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2023-05-23 |
| First published | 2020-01-02 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bianchui |

## Links

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

## Dependencies (9)

- [archiver](https://npm.io/package/archiver.md) ^3.0.0
- [commander](https://npm.io/package/commander.md) ^4.0.1
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.21.0
- [egret-node-utils](https://npm.io/package/egret-node-utils.md) 0.0.7
- [fs-extra-promise](https://npm.io/package/fs-extra-promise.md) ^1.0.1
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.21.5
- [@babel/preset-stage-0](https://npm.io/package/@babel/preset-stage-0.md) ^7.8.3
- [@babel/plugin-transform-strict-mode](https://npm.io/package/@babel/plugin-transform-strict-mode.md) ^7.18.6
- [@babel/plugin-proposal-function-bind](https://npm.io/package/@babel/plugin-proposal-function-bind.md) ^7.18.9

## Recent versions

- 1.0.9 (latest) — 2023-05-23
- 1.0.8 — 2021-02-04
- 1.0.7 — 2021-01-28
- 1.0.6 — 2021-01-11
- 1.0.5 — 2021-01-11
- 1.0.4 — 2020-04-27
- 1.0.3 — 2020-02-05
- 1.0.2 — 2020-01-03
- 1.0.1 — 2020-01-02

## README

# 发布`小游戏`项目包

通过`命令行`或`模块`方式对`小游戏`项目打包

## 以命令行方式安装

1. 安装 [nodejs](https://nodejs.org/en/) >= 8.0.0
2. 打开一个命令行终端，在其中输入`npm i wpak -g`
3. 执行 `wpak -v`，如果可以输出版本号，则表示执行成功

## 命令行方式使用

1. 一个准备发布的`小游戏`项目
2. 打开一个命令行终端，在其中输入 `wpak {your_wgame_project}` ，其中 `{your_wgame_project}` 是wgame项目路径
3. 执行完上述操作后，查看 `{project_root}_wgame` 文件夹

## 参数

    -v, --version                 output the version number
    -o, --outputDir <path>        output path, default to {project_root}_wgame path
    -m, --mainPackageName <name>  main package name, default to "minigame_entry"
    -e, --packageExt <ext>        package extension, default to ".rpk"
    -f, --forceBabel              force babel transform
    -h, --help                    output usage information

## 以Node模块方式使用

作为模块发布`小游戏`项目

### Example

``` javascript
// index.js
const wpak = require("wpak");

// 第二个参数 如果给出为 string 则 是 输出路径否则 可以指定一个 对象 作为配置
var config = {
    outputDir: "output_dir", // 指定输出路径
    mainPackageName: "main", // 修改主包名为： "main" 默认为 minigame_entry
    packageExt: ".xxx",      // 修改包扩展名为 .xxx， 默认为 .rpk
};

wpak.default("wgame_dir", "output_dir").then(() => {
    console.log('Done.');
}).catch((e) => {
    console.error(e.message);
    process.exit(1);
});
```

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