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

safefs

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safefs - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

47

out/lib/safefs.js

@@ -42,2 +42,45 @@ // Generated by CoffeeScript 1.6.2

},
getParentPathSync: function(p) {
var parentPath;
parentPath = p.replace(/[\/\\]$/, '').replace(/[\/\\][^\/\\]+$/, '');
return parentPath;
},
ensurePath: function(path, options, next) {
var _ref4;
if (next == null) {
next = options;
options = null;
}
if (options == null) {
options = {};
}
if ((_ref4 = options.mode) == null) {
options.mode = 0x1ff & (~process.umask());
}
safefs.exists(path, function(exists) {
var parentPath;
if (exists) {
return next(null, true);
}
parentPath = balUtilPaths.getParentPathSync(path);
return safefs.ensurePath(parentPath, options, function(err) {
if (err) {
return next(err, false);
}
return safefs.mkdir(path, options.mode, function(err) {
return safefs.exists(path, function(exists) {
if (!exists) {
err = new Error("Failed to create the directory: " + path);
return next(err, false);
}
return next(null, false);
});
});
});
});
return this;
},
readFile: function(path, options, next) {

@@ -61,3 +104,3 @@ if (next == null) {

}
safefs.ensurePath(pathUtil.dirname(path), function(err) {
safefs.ensurePath(pathUtil.dirname(path), options, function(err) {
if (err) {

@@ -80,3 +123,3 @@ return next(err);

}
safefs.ensurePath(pathUtil.dirname(path), function(err) {
safefs.ensurePath(pathUtil.dirname(path), options, function(err) {
if (err) {

@@ -83,0 +126,0 @@ return next(err);

2

package.json
{
"name": "safefs",
"version": "2.0.1",
"version": "2.0.2",
"description": "Say goodbye to EMFILE errors! Open only as many files as the operating system supports",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/bevry/safefs",

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