1.0.2 • Published 2 years ago

@licq/tpkg v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@licq/tpkg

pack or unpack wechatapp(.wxvpkg) and qqminiapp(.tqapkg) package.

NPM version NPM downloads

Install

npm i --save @licq/tpkg

API

pack

pack dir to pkg

Returns: pathLike
Since: v1.0.0

ParamTypeDescription
sourceDirpathLikerequired The directory to work with
targetPathpathLikeoptional The target path, The default path is the same as the sourceDir.
targetNamestringoptional 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

ParamTypeDescription
pkgPathpathLikerequired The pkgPath to work with
targetPathpathLikeoptional 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