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

bestzip

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bestzip - npm Package Compare versions

Comparing version 2.1.5 to 2.1.6

21

lib/bestzip.js

@@ -85,2 +85,14 @@ // creates a zip file using either the native `zip` command if available,

function walkDir(fullPath) {
const files = fs.readdirSync(fullPath).map(f => {
const filePath = path.join(fullPath, f);
const stats = fs.statSync(filePath);
if (stats.isDirectory()) {
return walkDir(filePath);
}
return filePath;
});
return files.reduce((acc, cur) => acc.concat(cur), []);
}
function addSource(source, next) {

@@ -94,3 +106,10 @@ const fullPath = path.resolve(cwd, source);

if (stats.isDirectory()) {
archive.directory(fullPath, destPath);
// Walk directory. Works on directories and directory symlinks.
const files = walkDir(fullPath);
files.forEach(f => {
const subPath = f.substring(fullPath.length);
archive.file(f, {
name: destPath + subPath
});
});
} else if (stats.isFile()) {

@@ -97,0 +116,0 @@ archive.file(fullPath, { stats: stats, name: destPath });

4

package.json
{
"name": "bestzip",
"version": "2.1.5",
"version": "2.1.6",
"description": "Uses OS zip command if avaliable (for better performance and speed) or node.js version if there is no system command avaliable. Can be called via node or command line.",

@@ -24,3 +24,3 @@ "main": "lib/bestzip.js",

"dependencies": {
"archiver": "^3.0.0",
"archiver": "^4.0.2",
"async": "^2.6.1",

@@ -27,0 +27,0 @@ "glob": "^7.1.3",

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