web2zip
v1.0.0
Published
An offline website to ZIP packager. Download any website and package all its css, js, and images into a single zip file. Can be run from the terminal or used as a module dependency.
Maintainers
Readme
⚡ WEB2ZIP | offline web packager
🛠 SYSTEM OVERVIEW
Web2Zip is an advanced command-line utility and developer dependency designed by Lord Indumina to scrape, extract, and bundle any public website along with all its local CSS, JS, and image assets into a single, fully functional offline ZIP file.
Whether you need to capture a landing page for local testing, archive a web page, or integrate web-to-zip compilation into your chat bots or automation pipelines, Web2Zip delivers speed and reliability directly on your machine.
🚀 KEY FEATURES
- Dual-Mode System: Run it as a terminal CLI tool or require/import it directly in your Node.js apps.
- Full Asset Crawling: Crawls and downloads stylesheets (
.css), scripts (.js), images (.png,.jpg,.jpeg, etc.), and site icons (.ico). - Smart Link Re-mapping: Rewrites internal asset pathways within the HTML to relative paths so the site works perfectly offline.
- Premium CLI Experience: Features a dynamic 24-bit truecolor horizontal gradient banner and real-time interactive progress indicators.
- User-Agent Masking: Sends standard browser headers to bypass simple bot-detection systems.
- Extremely Lightweight: Zero web server overhead, no heavy headless browser dependencies.
📦 INSTALLATION
Global Installation (For CLI Tool)
Install globally to run the web2zip command from anywhere on your terminal:
npm install -g .
# Or once published to npm:
# npm install -g web2zipLocal Installation (For Developer Dependency)
Install inside your Node.js project:
npm install web2zip💻 CLI TERMINAL USAGE
When run on your terminal, Web2Zip displays a colorful cyber-banner showing web2zip and the text from LORD INDUMINA, with a live asset progress indicator.
Command Syntax
web2zip <url> [options]Options
-o, --output <filename>: Specify the output ZIP file name (defaults tohostname_ext.zipin your current directory).-h, --help: Show help and usage instructions.
Examples
# Simple download (saves to example_com.zip)
web2zip https://example.com
# Custom output file
web2zip google.com -o google-offline.zip📡 DEVELOPER DEPENDENCY API (Node.js)
You can import Web2Zip into your server, WhatsApp/Telegram bot, or automation pipeline.
1. Write Directly to File
const web2zip = require('web2zip');
async function archive() {
try {
const outputPath = './offline-page.zip';
await web2zip.downloadToFile('https://example.com', outputPath, {
onProgress: (data) => {
console.log(`[${data.status}] ${data.message}`);
}
});
console.log('ZIP written successfully!');
} catch (error) {
console.error('Error bundling:', error);
}
}
archive();2. Generate ZIP Buffer (for Memory/API response)
const web2zip = require('web2zip');
async function getZipBuffer() {
// Returns a Promise resolving to a Node Buffer of the ZIP file
const buffer = await web2zip('https://example.com');
// Now you can send this buffer via an API response, upload it to S3, etc.
return buffer;
}Options & Configuration
You can pass an optional options configuration object as the second parameter:
const buffer = await web2zip(url, {
timeout: 20000, // HTTP request timeout in ms (default: 15000)
headers: { // Override or add custom headers
'Cookie': 'session=abc'
},
onProgress: (data) => { // Callback function to monitor scraper progress
console.log(data);
}
});📄 LICENSE
Designed by Lord Indumina. Licensed under the MIT License.
