2017-04-25 6 views
-1

のサイズの小さいフォルダの.zipファイルを作成するのに適切な解決策を教えてください。私たちは、少ないメモリでnodeJsを使用してシステムのフォルダを圧縮する方法

var FolderZip= require("folder-zip"); 
var options = { 
excludeParentFolder: true, 
parentFolderName: 'v1.0' 
}; 

//zip a folder and change folder destination name 
var zip = new FolderZip(); 
zip.zipFolder('./ExpressJs_sqlite3', options, function(){ 
zip.writeToFile('myfolder.zip'); 
}); 
/**it working properly but generated myfolder.zip size is more than the size 
of folder ExpressJs_sqlite3 
please help me with suitable solution creating .zip file for a folder with 
less size. 
kindly requesting you please dont put negative votes. It blocks me asking 
more questions am a new learner need your help. **/ 

答えて

0

はい...私は解決策を得ました。 npm install easy-zipを使用

//compress.js 
var EasyZip = require('easy-zip').EasyZip; 
var zip = new EasyZip(); 
//zip a folder 
zip.zipFolder('D:/sourav/sample/CRUD ExpressJs_sqlite3',function(){ 
zip.writeToFile('D:/sourav/sample/CRUD ExpressJs_sqlite3.zip'); 
}); 
関連する問題