{"library":"node-zip","title":"node-zip: Legacy Zip/Unzip Utility","description":"node-zip is a Node.js library for zipping and unzipping files, originally ported from an older version of JSZip. The current and only stable version is 1.1.1, which was last published over a decade ago in May 2015. This package is explicitly identified as a legacy and unmaintained project by the wider Node.js community, with strong recommendations against its use in new development due to potential security vulnerabilities, lack of modern features, and inherent performance limitations for large files. Modern alternatives like `jszip`, `adm-zip`, or `zip-stream` are recommended for active projects, offering better maintenance, asynchronous APIs, and streaming capabilities.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install node-zip"],"cli":null},"imports":["const Zip = require('node-zip');\nconst zipInstance = new Zip();"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const fs = require('fs');\nconst Zip = require('node-zip');\n\n// --- Zipping a file ---\nconst zip = new Zip();\nzip.file('my_test.txt', 'Hello, this is a test file content.');\nzip.file('another_folder/image.jpg', 'fake image data here, imagine a buffer'); // Can add binary data\n\nconst zippedData = zip.generate({ base64: false, compression: 'DEFLATE' });\n\n// IMPORTANT: When writing to a file, use 'binary' encoding.\nfs.writeFileSync('output.zip', zippedData, 'binary');\nconsole.log('Successfully created output.zip');\n\n// --- Unzipping a file ---\n// For demonstration, we'll read the file we just created\nconst zipBuffer = fs.readFileSync('output.zip', 'binary');\n\nconst unzip = new Zip(zipBuffer, { base64: false, checkCRC32: true });\n\nconsole.log('\\n--- Unzipped Content ---');\nconsole.log('Content of my_test.txt:', unzip.files['my_test.txt'].asText());\n// For binary files, you'd access .asBinary() or .asNodeBuffer()\nconsole.log('File metadata for another_folder/image.jpg:', unzip.files['another_folder/image.jpg']);","lang":"javascript","description":"This quickstart demonstrates how to create a ZIP archive with text and binary content, save it to disk, and then read/extract files from the created ZIP using `node-zip`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}