Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-compression

Package Overview
Dependencies
Maintainers
3
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-compression

Essential JS 2 Compression library


Version published
Weekly downloads
97K
decreased by-7.31%
Maintainers
3
Weekly downloads
 
Created

Package description

What is @syncfusion/ej2-compression?

@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.

What are @syncfusion/ej2-compression's main functionalities?

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);

Other packages similar to @syncfusion/ej2-compression

Readme

Source

A common package of Essential JS 2 compression libraries, methods and class definitions.

FAQs

Package last updated on 21 Jun 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc