1.0.0 • Published 2 years ago

nice-zip v1.0.0

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

nice-zip

Simple to zip or unzip archive file.

It used JSZip with version 3.x

How to use?

npm install nice-zip --save

import niceZip from 'nice-zip';

// Extra zip package to special folder
niceZip.unzip('1.zip', 'folder1', {
  onLoad: (len) => {
    console.log(`zip include files(include folders) is: ${len}`);
  },
  onProcess: (path, index, len) => {
    console.log(`Current file is ${path}, the index is ${index}, total count is ${len}`);
  },
});

// Zip folder to a zip file
const promise = niceZip.zipFolder(folder, targetPath);

Other options parames: https://stuk.github.io/jszip/documentation/api_jszip/load_async.html

You can use JSzip too, like this:

const JSZip = require('nice-zip').JSZip;

How to develop

Develop

npm run dev

Test

# 运行测试
npm test

# 运行测试并计算代码覆盖率
npm run cov

Publish

npm run pub
1.0.0

2 years ago

0.2.1

5 years ago

0.2.0

6 years ago

0.1.0

8 years ago