mt-resource-diff-patch
v1.3.3
Published
A diff and patch sdk for zip to gen patch package.
Downloads
140
Maintainers
Readme
前端资源包增量更新与补丁合并
resource-diff-patch
- 生成增量包
const { generatorPatchZip } = require('@mt/resource-diff-patch')
generatorPatchZip(
'/xxx/test_1.0.0.zip',
'/xxx/test_1.0.1.zip',
'/xxx/patchs',
'test_1.0.0_1.0.1.patch'
)
.then((patchResourceZipPath) => {
console.log(patchResourceZipPath)
})
.catch((e) => {
console.log(e)
})
- 打补丁到旧资源包
const { patchResource } = require('@mt/resource-diff-patch')
patchResource(
'/Users/mifind/Desktop/test/test.js.zip',
'/Users/mifind/Desktop/test/test.patch.zip',
'/Users/mifind/Desktop/test',
'test.new'
).then((res) => {
console.log(res)
})