unwxvpkg
Version:
unpack wx[av]pkg
47 lines (32 loc) • 748 B
Markdown
Unpack *.wx[va]pkg files.
Using npm:
```bash
$ npm i -g unwxvpkg
```
Using yarn:
```bash
$ yarn add -g unwxvpkg
```
unwxapkg <your *.wx[va]pkg file> [output folder]
```bash
unwxapkg core.wxvpkg
// or unwxvpkg core.wxvpkg
```
`unwxapkg` is same as `unwxvpkg`.
```js
const Wxapkg = require('unwxvpkg');
// import * as Wxapkg from 'unwxvpkg';
const fs = require('fs');
const path = require('path');
const file = fs.readFileSync('your.wxvpkg');
const wxapkg = new Wxapkg(file);
const files = wxapkg.decode();
files.forEach((f) => {
// custom handle file writing
fs.writeFileSync(path.join(process.cwd(), f.name), f.chunk, 'binary');
});
```