Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@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 Javascript 2 compression libraries, methods and class definitions.
FAQs
Essential JS 2 Compression library
The npm package @syncfusion/ej2-compression receives a total of 71,821 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 3 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.