adm-zip vs archiver vs compressing vs node-zip vs yauzl vs yazl vs zip-lib
Node.js ZIPライブラリ
adm-ziparchivercompressingnode-zipyauzlyazlzip-lib類似パッケージ:

Node.js ZIPライブラリ

ZIPライブラリは、Node.js環境でファイルやディレクトリを圧縮および解凍するためのツールです。これらのパッケージは、データの圧縮、アーカイブの作成、ファイルのストレージ効率の向上を目的としています。開発者は、これらのライブラリを使用して、ファイルの圧縮や解凍を簡単に行うことができ、アプリケーションのパフォーマンスを向上させることができます。

npmのダウンロードトレンド

3 年

GitHub Starsランキング

統計詳細

パッケージ
ダウンロード数
Stars
サイズ
Issues
公開日時
ライセンス
adm-zip02,161122 kB14424日前MIT
archiver02,95243.1 kB1562年前MIT
compressing045656.1 kB5112日前MIT
node-zip0217-2011年前-
yauzl080197.7 kB1525日前MIT
yazl037458.7 kB191年前MIT
zip-lib04370.2 kB112日前MIT

機能比較: adm-zip vs archiver vs compressing vs node-zip vs yauzl vs yazl vs zip-lib

APIの使いやすさ

  • adm-zip:

    adm-zipは、シンプルで直感的なAPIを提供しており、初心者でも簡単に使用できます。

  • archiver:

    archiverは、ストリームベースのAPIを提供しており、柔軟性がありますが、初学者には少し複雑に感じるかもしれません。

  • compressing:

    compressingは、さまざまな圧縮アルゴリズムをサポートしているため、APIはやや複雑ですが、強力です。

  • node-zip:

    node-zipは、基本的な機能に特化しており、非常にシンプルなAPIを提供しています。

  • yauzl:

    yauzlは、ZIPファイルの読み取り専用であり、APIはシンプルですが、書き込み機能はありません。

  • yazl:

    yazlは、ZIPファイルの作成に特化しており、ストリームベースのAPIを提供しています。

  • zip-lib:

    zip-libは、オブジェクト指向のアプローチを採用しており、柔軟なAPIを提供しています。

圧縮性能

  • adm-zip:

    adm-zipは、基本的な圧縮性能を提供しますが、大規模なデータには向いていません。

  • archiver:

    archiverは、高度な圧縮アルゴリズムを使用しており、大規模なデータセットを効率的に処理できます。

  • compressing:

    compressingは、さまざまな圧縮アルゴリズムをサポートしており、非常に高い圧縮性能を発揮します。

  • node-zip:

    node-zipは、シンプルな圧縮性能を提供しますが、他のライブラリに比べて劣ります。

  • yauzl:

    yauzlは、読み取り専用のため圧縮性能はありませんが、大きなZIPファイルの処理に優れています。

  • yazl:

    yazlは、高速な圧縮性能を提供し、大規模なデータの処理に適しています。

  • zip-lib:

    zip-libは、柔軟な圧縮性能を提供し、さまざまなシナリオに対応できます。

ストリーミングサポート

  • adm-zip:

    adm-zipは、ストリーミングをサポートしていないため、大きなファイルの処理には不向きです。

  • archiver:

    archiverは、ストリームベースのAPIを提供しており、大きなデータを効率的に処理できます。

  • compressing:

    compressingは、ストリーミングをサポートしており、リアルタイムでの圧縮が可能です。

  • node-zip:

    node-zipは、ストリーミングをサポートしていないため、大きなファイルには不向きです。

  • yauzl:

    yauzlは、読み取り専用でストリーミングをサポートしており、大きなZIPファイルを効率的に処理できます。

  • yazl:

    yazlは、ストリームベースのアプローチを採用しており、高速な圧縮が可能です。

  • zip-lib:

    zip-libは、ストリーミングをサポートしており、柔軟なデータ処理が可能です。

拡張性

  • adm-zip:

    adm-zipは、基本的な機能に特化しており、拡張性は限られています。

  • archiver:

    archiverは、プラグインやカスタマイズが可能で、拡張性に優れています。

  • compressing:

    compressingは、さまざまな圧縮アルゴリズムをサポートしており、高い拡張性を持っています。

  • node-zip:

    node-zipは、シンプルな機能に特化しており、拡張性は限られています。

  • yauzl:

    yauzlは、読み取り専用のため拡張性はありません。

  • yazl:

    yazlは、ストリームベースのアプローチを採用しており、拡張性があります。

  • zip-lib:

    zip-libは、オブジェクト指向のアプローチを採用しており、高い拡張性を持っています。

学習曲線

  • adm-zip:

    adm-zipは、シンプルなAPIのおかげで学習曲線が緩やかです。

  • archiver:

    archiverは、機能が豊富なため、学習曲線がやや急ですが、習得すれば強力です。

  • compressing:

    compressingは、さまざまな機能を持っているため、学習曲線が急ですが、パフォーマンスは優れています。

  • node-zip:

    node-zipは、シンプルな機能に特化しているため、学習曲線が緩やかです。

  • yauzl:

    yauzlは、読み取り専用のため、学習曲線は比較的緩やかです。

  • yazl:

    yazlは、ストリームベースのアプローチを採用しているため、学習曲線がやや急ですが、習得すれば強力です。

  • zip-lib:

    zip-libは、オブジェクト指向のアプローチを採用しているため、学習曲線がやや急ですが、柔軟性があります。

選び方: adm-zip vs archiver vs compressing vs node-zip vs yauzl vs yazl vs zip-lib

  • adm-zip:

    簡単なZIPファイルの読み書きが必要な場合は、adm-zipを選択してください。シンプルなAPIを提供し、使いやすさが特徴です。

  • archiver:

    多機能で柔軟な圧縮が必要な場合は、archiverを選択してください。ストリームベースのAPIを提供し、大規模なデータを処理するのに適しています。

  • compressing:

    高いパフォーマンスと多様な圧縮形式をサポートする必要がある場合は、compressingを選択してください。さまざまな圧縮アルゴリズムを利用できます。

  • node-zip:

    シンプルなZIPファイルの操作が必要な場合は、node-zipを選択してください。基本的な機能に特化しており、軽量です。

  • yauzl:

    ZIPファイルの読み取り専用の高速なライブラリが必要な場合は、yauzlを選択してください。大きなZIPファイルを効率的に処理できます。

  • yazl:

    ZIPファイルの作成に特化したライブラリが必要な場合は、yazlを選択してください。ストリームベースのアプローチで高いパフォーマンスを提供します。

  • zip-lib:

    オブジェクト指向のアプローチでZIPファイルを操作したい場合は、zip-libを選択してください。柔軟なAPIを提供し、拡張性があります。

adm-zip のREADME

ADM-ZIP for NodeJS

ADM-ZIP is a pure JavaScript implementation for zip data compression for NodeJS.

Build Status

Installation

With npm do:

$ npm install adm-zip

Electron file system support described below.

What is it good for?

The library allows you to:

  • decompress zip files directly to disk or in memory buffers
  • compress files and store them to disk in .zip format or in compressed buffers
  • update content of/add new/delete files from an existing .zip

Dependencies

There are no other nodeJS libraries that ADM-ZIP is dependent of

Examples

Basic usage

var AdmZip = require("adm-zip");

// reading archives
var zip = new AdmZip("./my_file.zip");
var password = "1234567890";
var zipEntries = zip.getEntries(); // an array of ZipEntry records - add password parameter if entries are password protected

zipEntries.forEach(function (zipEntry) {
    console.log(zipEntry.toString()); // outputs zip entries information
    if (zipEntry.entryName == "my_file.txt") {
        console.log(zipEntry.getData().toString("utf8"));
    }
});
// outputs the content of some_folder/my_file.txt
console.log(zip.readAsText("some_folder/my_file.txt"));
// extracts the specified file to the specified location
zip.extractEntryTo(/*entry name*/ "some_folder/my_file.txt", /*target path*/ "/home/me/tempfolder", /*maintainEntryPath*/ false, /*overwrite*/ true);
// extracts everything
zip.extractAllTo(/*target path*/ "/home/me/zipcontent/", /*overwrite*/ true);

// creating archives
var zip = new AdmZip();

// add file directly
var content = "inner content of the file";
zip.addFile("test.txt", Buffer.from(content, "utf8"), "entry comment goes here");
// add local file
zip.addLocalFile("/home/me/some_picture.png");
// get everything as a buffer
var willSendthis = zip.toBuffer();
// or write everything to disk
zip.writeZip(/*target file name*/ "/home/me/files.zip");

// ... more examples in the wiki

For more detailed information please check out the wiki.

Electron original-fs

ADM-ZIP has supported electron original-fs for years without any user interractions but it causes problem with bundlers like rollup etc. For continuing support original-fs or any other custom file system module. There is possible specify your module by fs option in ADM-ZIP constructor.

Example:

const AdmZip = require("adm-zip");
const OriginalFs = require("original-fs");

// reading archives
const zip = new AdmZip("./my_file.zip", { fs: OriginalFs });
.
.
.