New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vbarbarosh/node-helpers

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vbarbarosh/node-helpers - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

2

package.json

@@ -5,3 +5,3 @@ {

"name": "@vbarbarosh/node-helpers",
"version": "2.1.0",
"version": "2.2.0",
"description": "A set of helpers for JavaScript/Node.js",

@@ -8,0 +8,0 @@ "files": [

@@ -22,4 +22,9 @@ const fs_exists = require('./fs_exists');

// Error: EEXIST: file already exists, mkdir [...]
if (error.code == 'EEXIST') {
break;
if (error.code === 'EEXIST') {
// Exiting here is not correct. When two processes are running in parallel,
// one tries to create `a/b/c` and another `a`. When second process creates
// `a`, the first process will get `EEXIST` and stops (break) creating any
// nested directories, which is not correct.
// break;
continue;
}

@@ -26,0 +31,0 @@ throw error;

@@ -15,2 +15,11 @@ const assert = require('assert');

});
it('should create the same directory structure in parallel', async function () {
await fs_tempdir(async function (d) {
const tmp = fs_path_resolve(d, 'a/b/c/d/e/f/g/h');
await Promise.all(Array(10).fill(tmp).map(async function (v, i) {
await fs_mkdirp(tmp);
assert(await fs_fi(tmp).then(v => v.isDirectory()));
}));
});
});
});
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