🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

deterministic-zip-ts

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deterministic-zip-ts

A ZIP library that generates the same zip file from the same files every time

1.1.6
latest
Source
npm
Version published
Maintainers
1
Created
Source

deterministic-zip-ts

[!NOTE] Based on the original deterministic-zip by Erwin van der Koogh. Which works fine, but I needed something that I had control over, and I like Typescript, and async.

Regular zip binaries and libraries often generate different zip files from the same files most often because of metadata or timestamps. deterministic-zip-ts guarantees to always generate the same zip file every time.

This is a major problem when creating a reproducible build. The output from two builds from identical source would generate two different zip files.

With deterministic-zip-ts you are guaranteed to get the exact same file every time you build from the same input.

Features

  • Now supports async/await
  • Supports zip archives with more than 65k files
  • Always returns a zip with the exact same hash for files with the same content
  • Compresses in parallel, which is somehow faster than native zip (on the machine I tested it with)
  • Does not support files larger than 4GB

Install

npm install deterministic-zip-ts --save

Usage

import { zip } from 'deterministic-zip-ts';

await zip('data', 'test.zip', {
    includes: ['./index.js', './src/**'], 
    cwd: 'data'
});

FAQs

Package last updated on 08 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts