Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@syncfusion/ej2-compression
Advanced tools
@syncfusion/ej2-compression is a package that provides functionalities for compressing and decompressing files and data streams. It is part of the Syncfusion Essential JS 2 suite and is designed to work seamlessly with other Syncfusion components.
File Compression
This feature allows you to compress files into a ZIP archive. The code sample demonstrates how to create a ZIP archive and add a file to it, then save the archive to a specified path.
const { ZipArchive, ZipArchiveItem } = require('@syncfusion/ej2-compression');
let archive = new ZipArchive();
archive.addItem(new ZipArchiveItem('path/to/file.txt', 'file.txt'));
archive.save('path/to/archive.zip');
File Decompression
This feature allows you to decompress files from a ZIP archive. The code sample demonstrates how to load a ZIP archive and extract all its contents to a specified directory.
const { ZipArchive } = require('@syncfusion/ej2-compression');
let archive = new ZipArchive();
archive.load('path/to/archive.zip');
archive.extractAll('path/to/extract');
Stream Compression
This feature allows you to compress data streams into a ZIP archive. The code sample demonstrates how to create a ZIP archive and add a file stream to it, then save the archive to a specified path.
const { ZipArchive, ZipArchiveItem } = require('@syncfusion/ej2-compression');
const fs = require('fs');
let archive = new ZipArchive();
let readStream = fs.createReadStream('path/to/file.txt');
archive.addItem(new ZipArchiveItem(readStream, 'file.txt'));
archive.save('path/to/archive.zip');
Stream Decompression
This feature allows you to decompress data streams from a ZIP archive. The code sample demonstrates how to load a ZIP archive and extract a specific file to a write stream.
const { ZipArchive } = require('@syncfusion/ej2-compression');
const fs = require('fs');
let archive = new ZipArchive();
archive.load('path/to/archive.zip');
let writeStream = fs.createWriteStream('path/to/extract/file.txt');
archive.extractItem('file.txt', writeStream);
ADM-ZIP is a pure JavaScript implementation for ZIP file management. It provides functionalities for reading, creating, and updating ZIP files. Compared to @syncfusion/ej2-compression, ADM-ZIP is more focused on ZIP file manipulation and is widely used in the Node.js community.
Yazl is a ZIP file creation library for Node.js. It is designed to be fast and efficient, with a focus on streaming data into ZIP files. Compared to @syncfusion/ej2-compression, Yazl is more lightweight and specialized in ZIP file creation.
Yauzl is a ZIP file reading library for Node.js. It is designed to be fast and efficient, with a focus on streaming data out of ZIP files. Compared to @syncfusion/ej2-compression, Yauzl is more lightweight and specialized in ZIP file reading.
A common package of Essential JS 2 compression libraries, methods and class definitions.
FAQs
Essential JS 2 Compression library
The npm package @syncfusion/ej2-compression receives a total of 99,761 weekly downloads. As such, @syncfusion/ej2-compression popularity was classified as popular.
We found that @syncfusion/ej2-compression demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.