https://github.com/kejunmao/zzip
Use the command to compression dist to zip, tar, taz. 一行命令压缩 dist 为 zip, tar, taz.
https://github.com/kejunmao/zzip
compression dist npx zip
Last synced: 5 months ago
JSON representation
Use the command to compression dist to zip, tar, taz. 一行命令压缩 dist 为 zip, tar, taz.
- Host: GitHub
- URL: https://github.com/kejunmao/zzip
- Owner: KeJunMao
- License: mit
- Created: 2023-02-09T10:26:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T07:15:19.000Z (almost 2 years ago)
- Last Synced: 2025-04-22T21:02:52.309Z (5 months ago)
- Topics: compression, dist, npx, zip
- Language: TypeScript
- Homepage:
- Size: 88.9 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zzip
> Compression dist to zip, tar, taz. Powered by [compressing](https://www.npmjs.com/package/compressing)
English | [简体中文](./README.zh-CN.md)
## Quick Start
Compression the dist folder to dist.zip
```sh
npx zzip
# dist.zip
```Compression the dist folder to dist.tgz
```sh
npx zzip --mode=tgz
# dist.tgz
```Formating output name
```sh
npx zzip --name="format:dist-%cd%h"
# dist-2023-02-09-2421035.zip
```Formating date
```sh
npx zzip --name="format:dist-%cd-%tag" --date=format:"%Y%m%d"
# dist-20230209-v0.0.1.zip
```## CLI Usage
```sh
npx zzip [...args] []
```**Arguments:**
- `--outdir`: The output dir, **.** will be used as default.
- `--name`: The output name. When not provided, **format:%entry.name** will be used as default. Use `--name[=]` to format name. See [git commit formatting](https://www.git-scm.com/docs/git-log#Documentation/git-log.txt---prettyltformatgt), In addition to the formats provided by git, the following formats are supported:
- `%tag`: latest tag name
- `%entry.name`: first file/dir name
- `%package.name`: package.json displayName or name field
- `--mode`: Compression mode. When not provided, **zip** will be used as as default.
- `--overwrite`: Whether to overwrite the output file, **true** will be used as as default. When using `--no-overwrite`, an error will be thrown when the file exists
- `--date=`: **short** will be used as as default. see [more](https://www.git-scm.com/docs/git-log#Documentation/git-log.txt---dateltformatgt)## Configuration
Configuration is loaded by [unjs/c12](https://github.com/unjs/c12) from cwd. You can use either `zip.config.json`, `zip.config.{ts,js,mjs,cjs}`, `.ziprc`.
See [./src/config.ts](./src/config.ts) for available options and defaults.
## 💻 Development
- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` (use `npm i -g corepack` for Node.js < 16.10)
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`## License
Made with 💛
Published under [MIT License](./LICENSE).