@licq/tpkg
v1.0.2
Published
pack or unpack wechatapp and qqminiapp package
Downloads
13
Maintainers
Readme
@licq/tpkg
pack or unpack wechatapp(.wxvpkg)
and qqminiapp(.tqapkg)
package.
Install
npm i --save @licq/tpkg
API
pack
pack dir to pkg
Returns: pathLike
Since: v1.0.0
| Param | Type | Description | | --- | --- | --- | | sourceDir | pathLike | [required] The directory to work with | | targetPath | pathLike | [optional] The target path, The default path is the same as the sourceDir. | | targetName | string | [optional] The target filename, The default name is the same as the sourceDir. |
Example
const tpkg = require('@licq/tpkg')
const res = tpkg.pack('path/to/dir/');
const res = tpkg.pack('path/to/dir/', 'path/to/dir/demo');
const res = tpkg.pack('path/to/dir/', 'path/to/dir/demo', 'demo.wxvpkg') // or demo.tqapkg
//==> eg: path/to/dir/demo.wxvpkg
unpack
unpack pkg
Returns: pathLike
Since: v1.0.0
| Param | Type | Description | | --- | --- | --- | | pkgPath | pathLike | [required] The pkgPath to work with | | targetPath | pathLike | [optional] The target path, The default is the same as the pkgPath. |
Example
const tpkg = require('@licq/tpkg')
const res = tpkg.unpack('path/to/dir/demo.wxvpkg', _dirname) // or demo.tqapkg
//==> eg: ${_dirname}/demo/**
CLI
npm i -g @licq/tpkg
# unpack
tpkg path/to/demo.wxvpkg # unpack to path/to/*
tpkg path/to/demo.tqapkg # unpack to path/to/*
tpkg path/to/demo.wxvpkg path/to/target # unpack to path/to/target/*
# pack
tpkg path/to/demo # pack to path/to/demo.wxvpkg
tpkg path/to/demo path/to/target # pack to path/to/target/demo.wxvpkg
tpkg path/to/demo path/to/target demo.tqapkg # pack to path/to/target/demo.tqapkg