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

zip-zip-top

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zip-zip-top

Easily zip files & folder. Relies on jszip (https://stuk.github.io/jzip).

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

ZipZipTop is a nodejs modules which relies on jszip. It allows to simply add files & recursive folder in a zip.

Installation

$ npm install zip-zip-top

Examples

var ZipZipTop = require("zip-zip-top");

var zip = new ZipZipTop();
//add text
zip.file("hello.txt","Hello World!");
zip.writeToFile("text.zip");//write zip data to disk

//add folder
var zip2 = new ZipZipTop();
var jsFolder = zip2.folder("js");
jsFolder.file("hello.js","alert("hello world")");
zip2.writeToFile("folder.zip");

//add file
var zip3 = new ZipZipTop();
zip3.addFile("main.js","easyzip.js",function(err){
	if(err) {
		console.log(err);
	}
	zip3.writeToFile("file.zip");
});

//zip a folder
var zip4 = new ZipZipTop();
zip4.zipFolder("../myfolder",function(err){
	if(err) {
		console.log(err);
	}
	zip4.writeToFile("folder.zip", function(err) {
		if(err) {
			return console.log(err);
		}
		console.log("Done");
	});
});

//zip a folder and change folder destination name
var zip6 = new ZipZipTop();
zip6.zipFolder("../myfolder",function(){
if(err) {
		console.log(err);
	}
	zip6.writeToFile("myfolder.zip", function(err) {
		if(err) {
			return console.log(err);
		}
		console.log("Done");
	});
}, {rootFolder: "newRootFolder"});


//write to file sync
//zip.writeToFileSync(filePath);

License

MIT

Keywords

FAQs

Package last updated on 18 Apr 2016

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