# compress-to-zip

> Compress any file or folder to .zip format

Latest version **1.1.0** (published 2022-03-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install compress-to-zip
pnpm add compress-to-zip
yarn add compress-to-zip
bun add compress-to-zip
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-03-18 |
| First published | 2022-03-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anirban Pratihar |
| Maintainers | anirban_45 |
| Keywords | zip, zlib, compress, compress to zip, compress file npm, compress file in node |

## Links

- npm: https://www.npmjs.com/package/compress-to-zip
- Repository: https://github.com/Anirban-1490/Compress-to-ZIP
- Homepage: https://github.com/Anirban-1490/Compress-to-ZIP#readme
- Issues: https://github.com/Anirban-1490/Compress-to-ZIP/issues
- npm.io page: https://npm.io/package/compress-to-zip

## Dependencies (1)

- [zip-lib](https://npm.io/package/zip-lib.md) ^0.7.3

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-03-18
- 1.0.4 — 2022-03-18
- 1.0.3 — 2022-03-18
- 1.0.2 — 2022-03-18
- 1.0.1 — 2022-03-18
- 1.0.0 — 2022-03-18

## README

# Compress-to-ZIP
Compress any file or folder to .zip format

## Usage -

Import - 
```
const compress = require("compress-to-zip");

```
compress a single file - 

```
const compress = require("compress-to-zip");
compress.compressSingleFile("./test.txt","./test-compress.zip",(err)=>{
    if(err) return console.log(err.message) // if error show it
    console.log("done!") 
})

```

compress a single folder - 

```
const compress = require("compress-to-zip");
compress.compressSingleFolder("./testfolder","./testfolder-compress.zip",(err)=>{
    if(err) return console.log(err.message) // if error show it
    console.log("done!") 
})

```

compress a multiple (both files and folders) - 

```
const compress = require("compress-to-zip");
compress.compressMultiple({
    filePaths:["./test.txt"],
    folderPaths :["./testfolder"],
    compressPath:"./compressed.zip"
 },(err)=>{
    if(err) return console.log(err.message) // if error show it
    console.log("done!") 
})

```


## Reference 

### 1. compressSingleFile(sourceFilePath , compressFilePath,callbc)
  <br/>Compresses a single file from "sourceFilePath" to "compressFilePath" with a error first callback if failed

### 2. compressSingleFolder(sourceFolderPath , compressFolderPath,callbc)
 <br/>Compresses a single folder from "sourceFolderPath" to "compressFolderPath" with a error first callback if failed
 
### 3. compressMultiple(object,callbc)
  <br/>Compresses multiple files and folders together
  <br/> Object : {
    filePaths:[ ],
    folderPaths :[ ],
    compressPath:""
 }
 callbc : a error first callback if failed

---
_Source: https://npm.io/package/compress-to-zip · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
