|
||
---|---|---|
all | ||
bin | ||
core | ||
downloader | ||
linux | ||
mac | ||
windows | ||
.gitignore | ||
README.md |
README.md
@8zip
Monorepo for the 8zip NPM organization.
The goal of this project is to easily bundle 7zip executables for use in Node.js projects.
Packages
Package | Description |
---|---|
@8zip/bin | 7zip binary distribution which automatically detects the platform it's installed on |
@8zip/all | All 7zip binaries shipped without automatic platform detection |
@8zip/core | Simple wrapper around the 7zip binary |
@8zip/downloader | The automation code behind creating these packages |
@8zip/linux | Linux binaries for 7zip |
@8zip/mac | macOS binaries for 7zip |
@8zip/windows | Windows binaries for 7zip |
Usage
npm i @8zip/bin @8zip/core
yarn add @8zip/bin @8zip/core
pnpm add @8zip/bin @8zip/core
// if using @8zip/bin, @8zip/core will automatically detect the binary path
const { extract, compress } = require('@8zip/core')
await extract('path/to/file.7z', 'path/to/extract/to')
await compress('path/to/file.7z', 'path/to/compress')
More detailed documentation can be found in the core package.
Versioning
7zip uses a major.minor versioning scheme, whereas NPM uses a major.minor.patch versioning scheme. To reconcile this, the NPM packages will use the 7zip version as the major.minor version, and the patch version will be reserved for NPM package updates.
e.g. version 23.1.2
corresponds to 7zip version 23.01
, and the second revision of the NPM package. To preserve SemVer compatibility, the patch version will be reset to 0
when the major or minor version is incremented, and I strive to only introduce breaking changes when bumping the major version.
If you want the very specific package version, use the save-exact
flag when installing the package, or use the version lock syntax in your package.json
:
npm i @8zip/bin@23.1.2 -E
yarn add @8zip/bin@23.1.2 -E
pnpm add @8zip/bin@23.1.2 -E
{
"dependencies": {
"@8zip/bin": "23.1.2"
}
}