# pack2box3

> 打包在本地编写的box3代码并输出到一个文件中

Latest version **1.0.2** (published 2022-09-18) · MIT license · 0 weekly downloads

## Install

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

Provides the command `pack2box3`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-09-18 |
| First published | 2022-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | bcmray_crazy |
| Maintainers | bcmray_crazy |

## Links

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

## Dependencies (7)

- [chalk](https://npm.io/package/chalk.md) ^5.0.1
- [babylon](https://npm.io/package/babylon.md) ^6.18.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.1.0
- [commander](https://npm.io/package/commander.md) ^9.4.0
- [babel-core](https://npm.io/package/babel-core.md) ^6.26.3
- [babel-traverse](https://npm.io/package/babel-traverse.md) ^6.26.0
- [babel-preset-env](https://npm.io/package/babel-preset-env.md) ^1.7.0

## Recent versions

- 1.0.2 (latest) — 2022-09-18
- 1.0.0 — 2022-09-18

## README

# Pack 2 Box3
将本地js代码打包成一个文件供box3运行!

## 安装
- 全局安装
    ```bash
    $ npm install -g pack2box3
    ```
- 在项目中安装
    ```bash
    $ npm install pack2box3
    ```
    并在`package.json`下增加一下内容
    ```json
    "scripts":{
        "build":"pack2box3 pack ./main.js ./out.bundle.js"
    }
    ```

## 使用方法
```
pack2box3 <入口文件> <输出文件> [js种类]
```
js种类可以分为`module`和`commonjs`两种, 应该看名字就知道是啥了

## 示例
```javascript
// main.js
import sayHello from "./sayHello";
sayHello();

// sayHello.js
export default sayHello()
function sayHello() {
    return sayHello = () => {
        console.log('Hello!');
    };
}
```
打包
```bash
$ pack2box3 main.js out.bundle.js
```
out.bundle.js复制到box3里面并运行,可以看到控制台输出 `Hello!`

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