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

fs-sync

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-sync - npm Package Compare versions

Comparing version 0.2.2 to 0.2.4

24

dist/index.js

@@ -127,6 +127,22 @@ #!/usr/bin/env node

var exists = node_fs.existsSync ?
function (file) {
return node_fs.existsSync(file);
} :
// if node -v <= 0.6, there's no fs.existsSync method.
function (file) {
try {
node_fs.statSync(file);
return true;
} catch(e) {
return false;
}
};
// @returns {boolean} true if the file path exists.
sync.exists = function() {
var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath);
return exists(filepath);
};

@@ -138,3 +154,3 @@

var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath) && node_fs.lstatSync(filepath).isSymbolicLink();
return exists(filepath) && node_fs.lstatSync(filepath).isSymbolicLink();
};

@@ -145,3 +161,3 @@

var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath) && node_fs.statSync(filepath).isDirectory();
return exists(filepath) && node_fs.statSync(filepath).isDirectory();
};

@@ -152,3 +168,3 @@

var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath) && node_fs.statSync(filepath).isFile();
return exists(filepath) && node_fs.statSync(filepath).isFile();
};

@@ -155,0 +171,0 @@

@@ -0,5 +1,21 @@

var exists = node_fs.existsSync ?
function (file) {
return node_fs.existsSync(file);
} :
// if node -v <= 0.6, there's no fs.existsSync method.
function (file) {
try {
node_fs.statSync(file);
return true;
} catch(e) {
return false;
}
};
// @returns {boolean} true if the file path exists.
sync.exists = function() {
var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath);
return exists(filepath);
};

@@ -11,3 +27,3 @@

var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath) && node_fs.lstatSync(filepath).isSymbolicLink();
return exists(filepath) && node_fs.lstatSync(filepath).isSymbolicLink();
};

@@ -18,3 +34,3 @@

var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath) && node_fs.statSync(filepath).isDirectory();
return exists(filepath) && node_fs.statSync(filepath).isDirectory();
};

@@ -25,3 +41,3 @@

var filepath = node_path.join.apply(node_path, arguments);
return node_fs.existsSync(filepath) && node_fs.statSync(filepath).isFile();
return exists(filepath) && node_fs.statSync(filepath).isFile();
};

@@ -28,0 +44,0 @@

7

package.json
{
"name": "fs-sync",
"version": "0.2.2",
"version": "0.2.4",
"description": "synchronous fs with more fun",

@@ -13,4 +13,7 @@ "main": "dist/index",

"type": "git",
"url": "git://github.com/kaelzhang/fs-sync.git"
"url": "git@github.com:kaelzhang/node-fs-sync.git"
},
"bugs": {
"url": "https://github.com/kaelzhang/node-fs-sync/issues"
},
"keywords": [

@@ -17,0 +20,0 @@ "fs",

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