Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/adm-zip

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/adm-zip

TypeScript definitions for adm-zip

  • 0.5.7
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
624K
decreased by-6.12%
Maintainers
1
Weekly downloads
 
Created

What is @types/adm-zip?

@types/adm-zip provides TypeScript type definitions for the adm-zip library, which is used for handling ZIP archives. This package allows developers to work with ZIP files in a type-safe manner, ensuring better code quality and development experience.

What are @types/adm-zip's main functionalities?

Creating a ZIP Archive

This feature allows you to create a new ZIP archive and add files to it. The code sample demonstrates how to add a local file to a ZIP archive and then write the archive to disk.

const AdmZip = require('adm-zip');
const zip = new AdmZip();
zip.addLocalFile('file.txt');
zip.writeZip('archive.zip');

Extracting a ZIP Archive

This feature allows you to extract all files from a ZIP archive to a specified directory. The code sample shows how to extract the contents of 'archive.zip' to the 'output_folder' directory.

const AdmZip = require('adm-zip');
const zip = new AdmZip('archive.zip');
zip.extractAllTo('output_folder', true);

Reading ZIP Archive Contents

This feature allows you to read the contents of a ZIP archive. The code sample demonstrates how to list all the entries (files and directories) in 'archive.zip'.

const AdmZip = require('adm-zip');
const zip = new AdmZip('archive.zip');
const zipEntries = zip.getEntries();
zipEntries.forEach((entry) => {
  console.log(entry.entryName);
});

Adding Files and Folders to ZIP Archive

This feature allows you to add entire folders to a ZIP archive. The code sample shows how to add a folder located at 'folder_path' to a new ZIP archive and then write it to disk.

const AdmZip = require('adm-zip');
const zip = new AdmZip();
zip.addLocalFolder('folder_path');
zip.writeZip('archive.zip');

Other packages similar to @types/adm-zip

FAQs

Package last updated on 28 Nov 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc