New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pizzip

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pizzip

Create, read and edit .zip files synchronously with Javascript

  • 3.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
117K
decreased by-7.8%
Maintainers
0
Weekly downloads
 
Created

What is pizzip?

Pizzip is a JavaScript library for creating, reading, and editing zip files in the browser or Node.js. It is particularly useful for handling Office Open XML files, such as .docx, .xlsx, and .pptx, which are essentially zip files containing XML documents.

What are pizzip's main functionalities?

Create a new zip file

This feature allows you to create a new zip file and add files to it. In this example, a new zip file is created, and a text file named 'hello.txt' with the content 'Hello, World!' is added to it.

const PizZip = require('pizzip');
const zip = new PizZip();
zip.file('hello.txt', 'Hello, World!');
const content = zip.generate({ type: 'nodebuffer' });

Read a zip file

This feature allows you to read an existing zip file. In this example, a zip file named 'example.zip' is read, and the content of the file 'hello.txt' within the zip is extracted as text.

const PizZip = require('pizzip');
const fs = require('fs');
const data = fs.readFileSync('example.zip');
const zip = new PizZip(data);
const fileContent = zip.file('hello.txt').asText();

Modify a file within a zip

This feature allows you to modify the content of a file within an existing zip file. In this example, the content of 'hello.txt' within 'example.zip' is changed to 'Modified content'.

const PizZip = require('pizzip');
const fs = require('fs');
const data = fs.readFileSync('example.zip');
const zip = new PizZip(data);
zip.file('hello.txt', 'Modified content');
const newContent = zip.generate({ type: 'nodebuffer' });

Other packages similar to pizzip

Keywords

FAQs

Package last updated on 24 Jan 2025

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